android - Sideways Button On Edge of Screen -


i'm trying add button edge of screen this:

enter image description here

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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -