Układ Android - układ i waga
Muszę zbudować układ z zestawem układów liniowych. Układ musi zajmować określony procent ekranu. Muszę to zrobić, aby uzyskać podobny wygląd we wszystkich urządzeniach.
Kwestia:Mam widok tekstowy w górnym prawym układzie (pole koloru zielonego). Ilekroć dodaję dane do widoku tekstowego, zakłóca to cały układ, jak pokazano poniżej na drugim obrazie. Ale muszę zawijać dane automatycznie, gdy dotrze do prawego końca ekranu / układu.
Pomóż mi rozwiązać ten problem. Z góry dziękuję
Image1 - Widok graficzny zgodnie z XML przedstawionym poniżejImage2 - Pokazuje, jak układ zmienia się automatycznie, gdy dodaję dane do textViewxml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical"
android:weightSum="100">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="91"
android:weightSum="100">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="40"
android:weightSum="235">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="#ff0000"
android:layout_weight="100">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ffff00"
android:layout_weight="45">
<ViewFlipper
android:id="@+id/view_flipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/tvItemName" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
</ViewFlipper>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ffffff"
android:layout_weight="90">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="60"
android:weightSum="100">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="30"
android:background="#00ab00"
android:weightSum="100">
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:textColor="#000000"
android:text="Test data" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#cd00ab"
android:layout_weight="70">
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ab0000"
android:layout_weight="9">
</LinearLayout>
</LinearLayout>