i utiliser framelayout et à l'intérieur que j'ai 2 textview, si j'utilisemarges à l'intérieur framelayout ne fonctionne pas dans Android 2.2
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
Ma mise en page ne montre pas correcte dans Android 2.2, alors que le même travail bien dans Android 4.0.
Voici le code complet.
<?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>
Dans Android 2.2, il ressemble à ceci
Dans Android 4.0 ICS, il ressemble à ceci
Oui, les travaux de rembourrage. mais il ne me causera pas de problèmes si je passe à ICS, ou d'autres versions supérieures? – Naruto
Non, il n'y aura aucun problème avec les paddings dans ce cas. Vous pouvez le tester sur ICS (ou plus) si vous voulez :) –
Merci pour votre aide :) – Naruto