Android setup scrollview with relative layout -


i have next code:

<textview         android:id="@+id/textview3"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignleft="@+id/textview2"         android:layout_below="@+id/edittext1"         android:layout_margintop="30dp"         android:text="@string/cm_diameter"         android:textappearance="?android:attr/textappearancesmall" />      <textview         android:id="@+id/textview4"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignleft="@+id/textview3"         android:layout_below="@+id/textview3"         android:layout_margintop="28dp"         android:text="@string/from"         android:textappearance="?android:attr/textappearancesmall" /> 

the parameters using connected relative layout.

i want wrap text views (i have views well) using scroll view.

my image shows scroll view (green view) , below scroll view container (black view). how can achieve result?

i've tried use liner layout in scroll view has different result expected.

enter image description here

i don't know android:layout_margintop put in. design above try make simple layout this, , think work.

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >  <scrollview     android:layout_width="match_parent"     android:layout_height="0dp"     android:layout_weight="1"     android:background="#ff00ff00" >      <linearlayout         android:layout_width="match_parent"         android:layout_height="match_parent"         android:orientation="vertical"         android:padding="10dip" >          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="calculation" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:paddingleft="30dip"             android:text="item1"             android:textappearance="@android:style/textappearance.large" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginbottom="30dip"             android:text="another text view test"             android:textappearance="@android:style/textappearance.large" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginbottom="60dip"             android:text="another text view test"             android:textappearance="@android:style/textappearance.large" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginbottom="60dip"             android:text="another text view test"             android:textappearance="@android:style/textappearance.large" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginbottom="60dip"             android:text="another text view test"             android:textappearance="@android:style/textappearance.large" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginbottom="60dip"             android:text="another text view test"             android:textappearance="@android:style/textappearance.large" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginbottom="60dip"             android:text="another text view test"             android:textappearance="@android:style/textappearance.large" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginbottom="60dip"             android:text="another text view test"             android:textappearance="@android:style/textappearance.large" />          <textview             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginbottom="60dip"             android:text="another text view test"             android:textappearance="@android:style/textappearance.large" />     </linearlayout> </scrollview>  <framelayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:background="#ff000000"     android:padding="20dip" >      <button         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center"         android:text="add parameter" /> </framelayout> 

is right?


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -