0

绘制完美布局的最佳方法是什么,可以适应每个设备而不会出现密度/分辨率问题?

我使用了存储桶(layout-120dpi、layout-160dpi、layout-240dpi、layout-320dpi、layout-480dpi、layout-120dpi)。它是正确的?我会有问题吗?如果是的话,什么样的问题和这些设备?提前致谢

布局示例:

在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="This is a title"
    android:id="@+id/nick"
    android:layout_gravity="center_horizontal"
    android:textColor="#ff000000"
    android:layout_marginTop="15dp"
    android:textSize="25sp" />

<ImageView
    android:layout_width="270dp"
    android:layout_height="270dp"
    android:id="@+id/photo"
    android:background="#ffff0000"
    android:layout_gravity="center_horizontal"
    android:layout_marginTop="25dp" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="StackOverflowStackOverflowStackOverflowStackOverflowStackOverflowStackOverflowStackOverflowStackOverflow"
    android:id="@+id/state"
    android:textColor="#ff000000"
    android:layout_marginRight="10dp"
    android:layout_marginLeft="10dp"
    android:layout_marginTop="22dp" />
4

0 回答 0