android - min height fill_parent and height wrap_content in ScrollView? (or just the email app compose layout's code) -


question if have following:

<scrollview android:layout_width="fill_parent" android:layout_height="fill_parent">     <linearlayout android:layout_width="fill_parent" android:layout_height="?" android:orientation="vertical">         <edittext android:layout_width="fill_parent" android:layout_height="?" android:hint="subject" android:id="@+id/subject" />         <edittext android:layout_width="fill_parent" android:layout_height="?" android:id="@+id/body" />     </linearlayout> </scrollview> 

how can body (second edittext) fill rest of screen, still have scrollview kick in when contents of body long? height="wrap_content" , minheight="fill_parent"

layout_height="fill_parent" seems not if put them in scrollview

a working example of want email app compose window

i tried this , edittext elements act wrap_content , no filling happening. scrolling if type enough

<scrollview android:layout_width="fill_parent" android:layout_height="fill_parent">     <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">         <edittext android:layout_width="fill_parent" android:layout_height="fill_parent" layout_weight="1" android:hint="subject" android:id="@+id/subject" />         <edittext android:layout_width="fill_parent" android:layout_height="fill_parent" layout_weight="1" android:id="@+id/body" />     </linearlayout> </scrollview> 

i ran across link mail app source code in my accepted answer on question. answer simple! add android:fillviewport="true" <scrollview...> , add android:layout_weight="1.0" view want take available space. explained in blogspot


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -