驾驶自己的气,在过去几天后,我看到的StackOverflow的许多不同的页面,而不是answear我一直在寻找:(Android的布局重量/最大尺寸/咨询
我想创建一个拼图Android手机,或者更好。所有的Android设备
我应该集中精力使这个程序与所有Android设备兼容,包括(非常小)2,7" 和真正的大(7" +)设备?或者我应该坚持在3.2“至4.7”的应用程序“看起来不错并且有效”?
更大的屏幕有更多的空间,所以屏幕文字可以更大。我如何自动让应用程序设置正确的屏幕文字大小?到目前为止,我已经创建了下面的代码。尽管它看起来没有多大用处,但使用
sp
来表示文字大小。如果您推荐我为平板电脑制作应用程序,我如何在下面的源代码中为按钮设置最大宽度,但是最小重量可以说是
90%
?<Button android:id="@+id/BTN_StartGame" android:layout_width="250dp" android:layout_height="30dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:background="@drawable/mainbutton" android:text="@string/BTN_StartGame" android:textColor="@color/White" android:textSize="16sp" /> <Button android:id="@+id/BTN_Settings" android:layout_width="250dp" android:layout_height="30dp" android:layout_marginTop="50dp" android:background="@drawable/mainbutton" android:text="@string/BTN_Settings" android:textColor="@color/White" android:textSize="16sp" /> <Button android:id="@+id/BTN_Tutorial" android:layout_width="110dp" android:layout_height="30dp" android:layout_marginTop="100dp" android:background="@drawable/mainbutton" android:text="@string/BTN_Tutorial" android:textColor="@color/White" android:textSize="16sp" /> <Button android:id="@+id/BTN_Rules" android:layout_width="110dp" android:layout_height="30dp" android:layout_marginTop="100dp" android:layout_alignParentRight="true" android:background="@drawable/mainbutton" android:text="@string/BTN_Rules" android:textColor="@color/White" android:textSize="16sp" /> <Button android:id="@+id/BTN_About" android:layout_width="250dp" android:layout_height="30dp" android:layout_marginTop="230dp" android:background="@drawable/mainbutton" android:text="@string/BTN_About" android:textColor="@color/White" android:textSize="16sp" />