创建一个简单的XML设计如下,当我面临着一个奇怪的问题在我的项目之间安卓布局设计:差异2.3.3版本和4+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#FF0000"
android:layout_marginLeft="30dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button"
android:layout_gravity="left|center_vertical"/>
现在看到了差距,这是在4.2.2视图:
而这一次在2.3.3:
希望如果有人可以帮我一下吧。感谢
出于好奇,你为什么要设置layout_gravity left和center_vertical? – FoamyGuy 2013-04-22 14:14:49
呃...那有什么区别?你想让它“被完整”吗? – Ahmad 2013-04-22 14:14:57
@Ahmad黑吧(大概是边缘)是在相反的两侧 – FoamyGuy 2013-04-22 14:15:29