梦诗文件与nexus4&安培值,sw360dp冲突; nexus5 UI [英] dimens file in values-sw360dp clashes with nexus4 & nexus5 UI
问题描述
创建在纵向模式下应用的时候,有一个基于上边距来对齐按钮
图像。我使用梦诗
文件中的价值观sw360dp
这是在寻找的正确的Nexus 5 但相同的价值观不对齐的承上启下的按钮
4 既是使用这些设备的价值观sw360dp
文件夹梦诗文件。
Creating an application in portrait mode where I have to align Button
on image based on top margin. I'm using dimens
file in values-sw360dp
which is looking proper in nexus 5 but the same values is not aligning the Buttons
in nexus 4 as both of the devices using values-sw360dp
folder for dimens file.
您可以请建议此解决方案。也可以对任一规定,应结合起来,支持多屏幕的所有可能值的文件夹列表
Can you please suggest the solution for this. Also can any one provide list of all possible values folder that should be integrated to support multiple screens
以下是code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/windowBackground">
<ImageView
android:id="@+id/bc_logo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitStart"
android:src="@drawable/bc_imgbc_logo" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/bc_logo"
android:orientation="horizontal"
android:weightSum="1"
android:layout_alignParentTop="true"
android:layout_marginTop="@dimen/bc_img_margin_top">
<Button
android:id="@+id/login_btn"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:background="@drawable/signing_tab_btn"
android:text="SIGN IN"
android:textColor="@color/colorAccent" />
<Button
android:id="@+id/registration_btn"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:text="REGISTER"
android:textColor="#FFFFFF" />
</LinearLayout>
</RelativeLayout
在上面code我需要对齐的LinearLayout
在的ImageView
因此,使用的android:layout_marginTop =@扪/ bc_img_margin_top
设置保证金
In above code I need to align the LinearLayout
on the ImageView
so using android:layout_marginTop="@dimen/bc_img_margin_top"
for setting margin.
我在图像&LT; ImageView的/&GT;
我不得不放弃的高度和宽度匹配家长为了保持纵横比和占据屏幕的宽度,这导致了我想要的屏幕上方,但&LT的区域显示图像; ImageView的/&GT;
被占据整个屏幕的面积,我要对齐的&LT;的LinearLayout /方式&gt;
有形象上的底部按钮
I have the Image in <ImageView/>
which i have to give height and width as match parent in order to maintain aspect ratio and occupy width of screen so this results in the image showing in the area i wanted top of screen but the <ImageView/>
is occupying area of whole screen and I want to align the <LinearLayout/>
having buttons on the bottom part of Image.
以下是图像,其中在按钮有黄色下划线和登录注册需要在白色文本按钮上的图像的底部大部分要对齐,其中图像结束。而蓝色区域描绘了覆盖整个装置高度占用的面积。
Following is the image in which the sign in button with yellow underline and register button in white text needs to be aligned on bottom most part of the image where image ends. and the blue area depicts the area occupied by which covers the whole device height.
推荐答案
创建这种价值对于结构法不同大小的
Create this kind of value structre for different sizes
这篇关于梦诗文件与nexus4&安培值,sw360dp冲突; nexus5 UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!