android - Make a view next to another and at the middle of its height -
i'm trying make activity
numberpicker
, textview
, want textview
next numberpicker
, @ middle of numberpicker
height (the tv going "choose number:") thing i've tried didn't worked. (i tried put 1 in different linearlayout
, 2 linearlayouts
in relativelayout
, messed prefences , still didn't work)
here tried:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" 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=".mainactivity" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentend="true" android:paddingtop="30dp" android:text="@string/main"/> <numberpicker android:id="@+id/numberpicker1" android:layout_width="30dp" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_tostartof="@+id/textview1" android:clickable="false" android:paddingtop="0dp" /> </relativelayout>
thanks!
i following kind of situations:
<textview ... android:layout_aligntop="@+id/numberpicker1" android:layout_alignbottom="@+id/numberpicker1" android:gravity="center_vertical" />
this way tex view appears in middle of number picker. way remind, should put number picker before text view if want try method.
good luck!
Comments
Post a Comment