I need to create XML with the following content:
* Two TextViews with changing text (1-3 lines), one TextView below the other.
* One ImageView to the right of 2 TextViews, centered vertically, 30x30 pixels.
One of the main limitations is that it cannot occupy the entire screen when pumping in PopupWindow, which means that I cannot use the fill_parent attributes in many places.
I tried many different layouts, but TextViews repels TextViews when it is long. When the text is βhalf long,β the image becomes tiny but still visible. I want it to always be 30x30 pixels in size, you can wrap text and use a different line instead.
I tried to specify values ββfor width and minWidth. Also tried layout_weight = "1" for ImageView. I also tried to wrap ImageView in LinearLayout and give this parameter layout_weight = "1". Nothing works
Here is an example of what doesn't work:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:id="@+id/popupTitle" android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/popupContent"
android:layout_width="wrap_content" android:layout_height="wrap_content"/>
</LinearLayout>
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/img_30x30_px" />
</LinearLayout>
source
share