android - ImageButton not showing to right of TextView in RelativeLayout -
i need have imagebutton right of textview in relativelayout , i've tried code:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#cc000000"> <textview android:id="@+id/quality" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_marginleft="20dp" android:layout_marginbottom="20dp" android:textcolor="#666666" android:text="@string/default_bitrate" /> <imagebutton android:id="@+id/arrow" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@null" android:layout_torightof="@+id/quality" android:src="@drawable/ico_arrow" > </imagebutton> the unusual thing imagebutton doesn't show scenario. can see textview. where's error ?
change textview width wrap content. setting match_parent, textview take entire width of screen hence can't see image
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#cc000000" > <textview android:id="@+id/quality" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_marginbottom="20dp" android:layout_marginleft="20dp" android:text="@string/default_bitrate" android:textcolor="#666666" /> <imagebutton android:id="@+id/arrow" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_aligntop="@+id/quality" android:layout_torightof="@+id/quality" android:background="@null" android:src="@drawable/ico_arrow" > </imagebutton> android textview relativelayout imagebutton
No comments:
Post a Comment