android - Cant make ScrollView to work -
i have layout filled edit text, purpose save user's inputs, have lot's of them , want put more don't have enough space in 5'' phone make them appear, , need scroll in order see other inputs.at moment have xml can't make scrollview
work! , need make work entire view. can guys me out , tell me doing wrong ? thanks!
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/scrollview01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillviewport="true" > <relativelayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/teste" android:gravity="bottom" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.luisalmeida.theblackbook.addhookupactivity$placeholderfragment" > <edittext android:id="@+id/edittextfrom" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@+id/textviewlocation" android:layout_alignleft="@+id/edittextplace" android:ems="10" /> <edittext android:id="@+id/edittextname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@+id/textviewname" android:layout_alignright="@+id/edittextplace" android:layout_torightof="@+id/textviewplace" android:ems="10" /> <textview android:id="@+id/textviewlocation" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/textviewobs" android:layout_alignleft="@+id/textviewplace" android:layout_marginbottom="21dp" android:text="@string/homehookup" android:textappearance="?android:attr/textappearancemedium" android:textcolor="@color/teste2" /> <textview android:id="@+id/textviewobs" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/edittextobs" android:layout_alignleft="@+id/textviewlocation" android:layout_marginbottom="13dp" android:text="@string/obshookup" android:textappearance="?android:attr/textappearancemedium" android:textcolor="@color/teste2" /> <textview android:id="@+id/textviewplace" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/edittextfrom" android:layout_alignleft="@+id/textviewage" android:layout_marginbottom="14dp" android:text="@string/placehookup" android:textappearance="?android:attr/textappearancemedium" android:textcolor="@color/teste2" /> <edittext android:id="@+id/edittextplace" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@+id/textviewplace" android:layout_torightof="@+id/textviewplace" android:ems="10" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/edittextplace" android:layout_alignleft="@+id/textviewname" android:layout_marginbottom="7dp" android:text="@string/agehookup" android:textappearance="?android:attr/textappearancemedium" android:textcolor="@color/teste2" /> <edittext android:id="@+id/edittextage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@+id/textviewage" android:layout_torightof="@+id/textviewplace" android:ems="10" /> <textview android:id="@+id/textviewname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/edittextage" android:layout_alignparentleft="true" android:layout_marginbottom="11dp" android:layout_marginleft="31dp" android:text="@string/namehookup" android:textappearance="?android:attr/textappearancemedium" android:textcolor="@color/teste2" /> <edittext android:id="@+id/edittextobs" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/textviewobs" android:layout_alignparentbottom="true" android:layout_alignright="@+id/edittextfrom" android:layout_marginbottom="82dp" android:ems="10" > </edittext> <button android:id="@+id/buttonsave" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignright="@+id/textviewplace" android:layout_marginbottom="14dp" android:text="@string/savehookup" android:onclick="savehookup" /> </relativelayout> </scrollview>
maybe try instead:
<scrollview> <tablelayout> <tablerow> <textview/> <edittext/> </tablerow> <tablerow> <textview/> <edittext/> </tablerow> <tablerow> <textview/> <edittext/> </tablerow> <tablerow> <textview/> <edittext/> </tablerow> // add other edittext , textview here </tablelayout> </scrollview>
update 1:
@luisalmeida: doesn't stop adding more 1 components tablerow
can name: "input here" layout (see updated layout above). also, layout posted above doesn't give name: "input here" layout anyway, unless i'm missing something.
Comments
Post a Comment