Android RelativeLayout placing 2 views next to eachother one view is variable? -


i looking @ placing 2 views next each other. 1 view has fixed width while other should take rest of space (variable).

i have set layout fixed width view alignparentright="true" fine overlaps variable width view.

i them side-by-side. maybe horizontal linearlayout best task?

what have is:

<listview     android:id="@+id/list"     android:layout_width="match_parent"     android:layout_height="match_parent"/>  <selector     android:id="@+id/side_selector"     android:layout_width="30dp"     android:layout_height="match_parent"     android:layout_alignparentright="true"     android:layout_alignparentend="true"     /> 

you have use linearlayout layou_weigth, :

<linearlayout     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="horizontal">      <listview         android:id="@+id/list"         android:layout_width="0dp"         android:layout_height="match_parent"         android:layout_weight="1"/>      <selector         android:id="@+id/side_selector"         android:layout_width="wrap_content"         android:layout_height="match_parent"/>  </linearlayout> 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -