[英]android main XML works diffrent on 2.3 and 4.0
此XML在2.3和4.0上的工作方式有所不同。 其中之一顯示表格行元素保留為左對齊,但其他居中。
謝謝你的幫助
<LinearLayout android:id="@+id/Scorelistic" android:layout_marginLeft="70dp" android:layout_marginTop="30dp" android:layout_gravity="center" android:background="@drawable/bestscore" android:layout_height="267dp" android:layout_width="432dp" android:orientation="vertical" android:weightSum="1">
<TableLayout android:layout_height="fill_parent" android:weightSum="1" android:layout_marginTop="50dp" android:id="@+id/tableLayout1" android:layout_gravity="center" android:layout_width="fill_parent">
<TableRow android:layout_height="85dp" android:layout_width="wrap_content" android:id="@+id/tableRow1">
<FrameLayout android:layout_width="349dp" android:layout_height="74dp" android:id="@+id/frameLayout5">
<ImageView android:layout_height="74dp" android:id="@+id/score1" android:layout_marginLeft="80dp" android:layout_width="349dp" android:background="@drawable/birincibg" android:visibility="visible"></ImageView>
<TextView android:id="@+id/birinci" android:textSize="16sp" android:layout_marginLeft="80dp" android:gravity="center" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="#000000"></TextView>
</FrameLayout>
</TableRow>
</TableLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
這可能是因為您要指定設備點,因此整個布局取決於您設備的屏幕尺寸。 因此,如果您的兩個設備的屏幕尺寸不同,則會看到差異。 通常不建議在可能要使用重力,路線和權重的布局中使用設備點。 特別是在TableLayouts中,您實際上並不需要設備點,所以似乎
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.