我使用的FrameLayout和內,我有2個TextView的,如果我使用邊距未Android平臺2.2
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
我的佈局沒有顯示在Android 2.2的正確,而在Android上同樣做工精細4.0。
這裏是完整的代碼。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:gravity="left|center"
android:text= "Testing String"
android:textSize="15sp"
android:textColor="@color/LIGHTGRAY"
android:layout_gravity="left|top"/>
<TextView
android:id="@+id/ID_due_date"
android:textStyle="bold"
android:textSize="15sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text= "Testing String"
android:layout_marginTop="10dp"
android:layout_gravity="right"
android:gravity="left|center"/>
</FrameLayout>
</ScrollView>
在Android 2.2系統,它看起來像這樣
在搭載Android 4.0 ICS,它看起來像這樣
是,填充作品。但如果我轉移到ICS或其他更高版本,它不會給我帶來任何問題嗎? – Naruto
不,在這種情況下填充物不會有問題。你可以在ICS(或更高版本)上測試它,如果你想:) –
謝謝你的幫助:) – Naruto