android - Sideways Button On Edge of Screen -
i'm trying add button edge of screen this:
i tried using code below since rotation around center there space on right side of button half length of button.
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentend="true" android:layout_centervertical="true" android:rotation="270" android:text="button" /> </relativelayout>
use relativelayout
access attribute layout_alignparentend
button
. if root layout relativelayout
use that, if not can wrap button
in relativelayout
, use layout. if choose latter option, need position layout.
<relativelayout android:id="@id+/wrapper_or_root" android:layout_width="wrap_content" android:layout_height="wrap_content"> <button android:id="@+id/mybutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentend="true" android:layout_gravity="center_vertical|right" android:rotation="270"/> </relativelayout>
Comments
Post a Comment