This is a simple question:
I have a layout file that is presented as an element inside a ListView. I set the height of the RelativeLayout to 100dp, but it does not work, it always wraps the contents, no matter what layout I use. What can I do to set a fixed value to the height of the layout without wrapping it?
Thanks for the help.
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="100dp"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true"> <ProgressBar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/progressbar_small" android:layout_height="@dimen/progressbar_small" android:layout_gravity="center_vertical" /> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:text="@string/loading" android:layout_gravity="center_vertical" style="@style/ListItemSubtext" /> </LinearLayout> </RelativeLayout>
source share