android - layout_height always wrapping content -


it's simple question:

i have layout file presented item inside of listview. set height of relativelayout 100dp, not work, it's wrapping content, no matter layout use. can set fixed value layout height without having wrapping?

thanks 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"> <!-- attribute seems ignored -->      <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> 

i think in list view items of same height. in case add progress bar in list footer view. add dummy height adjuster right before or after listitemsubtext. try using tablelayout instead of relative , linear layout.

a dummy adjuster this.

<view android:layout_width="wrap_content" android:layout_height="100dip"/> 

please note not need xmlns in every element.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -