In Android App, How to arrange "a block of two vertical TextViews" and "one ImageView" with android:layout_weight



I am developing an Android App.


In xml, I would like to arrange "a block of two vertical TextViews" and "one ImageView" with android:layout_weight, and the value of the former is 2 and the one of the latter is 1.


My code is following. However it doesn't work.(forced termination)



<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="100dp"
android:minHeight="100dp"
android:weightSum="3"
>

<LinearLayout
android:id="@+id/article"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="2"
android:orientation="vertical" >

<TextView
android:id="@+id/articleTitle"
android:choiceMode="singleChoice"
android:layout_height="20dp"
android:minHeight="20dp"
/>
<TextView
android:id="@+id/articleAbstract"
android:choiceMode="singleChoice"
android:layout_height="80dp"
android:minHeight="80dp"
/>

</LinearLayout>

<ImageView
android:id="@+id/image"
android:layout_width="0dp"
android:layout_height="100dp"
android:minHeight="100dp"
android:layout_weight="1"
/>

</LinearLayout>


Could you tell me how to solve this problem?


No comments:

Post a Comment