Hey, nach 2 Wochen habe ich nun ein halbwegs gut aussehendes Layout hinbekommen, auf meinen Samsung Galaxy S2 sieht dieses auch super aus, doch passt sich das Layout nicht an größere oder kleinere Bildschirme an.
Hat jemand einen Trick, wie ich das ohne viel aufwand hinbekomme?
hier mal mein layout code:
Code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/Grey" >
<LinearLayout
android:layout_width="198sp"
android:layout_height="match_parent"
android:background="@color/Grey"
android:gravity="center_horizontal"
android:orientation="vertical" >
<Spinner
android:id="@+id/Cartyp"
android:layout_width="180sp"
android:layout_height="45sp"
android:layout_marginTop="2sp"
android:entries="@array/Typ"
android:gravity="center"
android:prompt="@string/prompt" />
<LinearLayout
android:layout_marginTop="2sp"
android:layout_width="190sp"
android:layout_height="wrap_content"
android:background="@drawable/black_border"
android:gravity="center_horizontal"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/readed"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12sp" />
<EditText
android:id="@+id/ReadedCode"
android:layout_width="190sp"
android:layout_height="30sp"
android:gravity="center_horizontal"
android:inputType="number"
android:maxLength="8"
android:textSize="12sp" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_marginTop="4sp"
android:layout_width="190sp"
android:layout_height="wrap_content"
android:background="@drawable/black_border"
android:gravity="left"
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/ExtraFunc"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12sp" />
<CheckBox
android:id="@+id/PosKnown"
android:layout_width="wrap_content"
android:layout_height="30sp"
android:text="@string/PosOne"
android:textSize="10sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<CheckBox
android:id="@+id/Group1"
android:layout_width="90sp"
android:layout_height="30sp"
android:checked="true"
android:text="@string/GroupOne"
android:textSize="10sp" />
<CheckBox
android:id="@+id/Group2"
android:layout_width="wrap_content"
android:layout_height="30sp"
android:checked="true"
android:text="@string/GroupTwo"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
<Button
android:layout_marginTop="4sp"
android:id="@+id/start"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:text="@string/Button" />
</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp" >
<TableLayout
android:id="@+id/keyTable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp" >
<TableRow android:id="@+id/tableCap" android:layout_width="match_parent" android:layout_height="wrap_content">
<TextView
android:id="@+id/CapKey"
android:layout_width="110sp"
android:layout_height="wrap_content"
android:background="@drawable/cell_shape"
android:gravity="center"
android:padding="5sp"
android:text="@string/Key"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/Black" >
</TextView>
<TextView
android:id="@+id/CapLeft"
android:layout_width="110sp"
android:layout_height="wrap_content"
android:background="@drawable/cell_shape"
android:gravity="center"
android:padding="5sp"
android:text="@string/Left"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/Black" >
</TextView>
<TextView
android:id="@+id/CapRight"
android:layout_width="110sp"
android:layout_height="wrap_content"
android:background="@drawable/cell_shape"
android:gravity="center"
android:padding="5sp"
android:text="@string/Right"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/Black" >
</TextView>
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
Alles anzeigen