Android ScrollView Overlaps - Weight? -
i have following layout, , reason scrollview overlaps on views. don't quite understand whole use of weight , layout_weight attribute in android. thinking has problem.
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:id="@+id/topbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:adjustviewbounds="true" android:scaletype="fitxy" /> <imageview android:id="@+id/secondbar" android:adjustviewbounds="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@+id/topbarr" android:scaletype="fitxy" /> <scrollview android:id="@+id/buttonlistview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_below="@+id/secondbar" android:scrollbarfadeduration="0" > </scrollview> </relativelayout>
firstly, should have 1 view android:layout_alignparenttop="true"
if want views 1 below another.
secondly, need use @+id
once each variable. once it's declared, refer @id
.
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:id="@+id/topbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:adjustviewbounds="true" android:scaletype="fitxy" /> <imageview android:id="@+id/secondbar" android:adjustviewbounds="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@id/topbar" android:scaletype="fitxy" /> <scrollview android:id="@+id/buttonlistview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_below="@id/secondbar" android:scrollbarfadeduration="0" > </scrollview> </relativelayout>
Comments
Post a Comment