button - Android - How to position 4 text views? -
update: i've opened new thread updated question here: android - how display 4 text views icons? thank answers, i'd appreciate if me newer thread above.
i'm trying display 4 text views @ bottom of screen can't figure out how that. every time try move 1 button screws rest.
here's looks like:
here's manuel marks want position buttons (each line represents text view item position):
here's current code, pointers great:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:context=".mainactivity" > <android.support.v4.view.viewpager android:id="@+id/view_pager" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:adjustviewbounds="true" > </android.support.v4.view.viewpager> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_margintop="124dp" android:layout_torightof="@+id/buttonrate" android:text="textview" /> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbaseline="@+id/textview1" android:layout_alignbottom="@+id/textview1" android:layout_alignright="@+id/buttonwallpaper" android:text="textview" /> <textview android:id="@+id/buttonwallpaper" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_below="@+id/textview2" android:layout_marginright="50dp" android:layout_margintop="137dp" android:clickable="true" android:onclick="setwallpaper" android:text="@string/set_wallpaper" android:textcolor="@color/red" /> <textview android:id="@+id/buttonrate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbaseline="@+id/buttonwallpaper" android:layout_alignbottom="@+id/buttonwallpaper" android:layout_alignparentleft="true" android:layout_marginleft="50dp" android:clickable="true" android:onclick="rate" android:text="@string/rate_button" android:textcolor="@color/red" />
i'm stuck.
thanks in advance, dvir
you need put relative layout after viewpager
textviews, , add android:layout_alignparentbottom="true"
layout
this:
<android.support.v4.view.viewpager android:id="@+id/view_pager" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:adjustviewbounds="true" > </android.support.v4.view.viewpager> <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_torightof="@+id/buttonrate" android:text="textview" /> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbaseline="@+id/textview1" android:layout_alignbottom="@+id/textview1" android:layout_alignright="@+id/buttonwallpaper" android:text="textview" /> <textview android:id="@+id/buttonwallpaper" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_below="@+id/textview2" android:layout_marginright="50dp" android:clickable="true" android:onclick="setwallpaper" android:text="hello" /> <textview android:id="@+id/buttonrate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbaseline="@+id/buttonwallpaper" android:layout_alignbottom="@+id/buttonwallpaper" android:layout_alignparentleft="true" android:layout_marginleft="50dp" android:clickable="true" android:onclick="rate" android:text="hello2" /> </relativelayout>
also note i've deleted android:layout_margintop
parameters, can adjust it, if wish
Comments
Post a Comment