set Android ZoomButtonsController alignment?

前端 未结 1 1005
我寻月下人不归
我寻月下人不归 2020-12-22 08:29

Im implementing a ZoomButtonsController in my custom View and have been trying to figure out how to align it to the bottom right hand corner of the screen (it aligns to the

相关标签:
1条回答
  • 2020-12-22 09:03

    ZoomButtonsController can be defined in XML files and can be positioned accordingly , for eg.

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
    
    <ZoomControls android:id="@+id/zoomControls1" 
              android:layout_height="wrap_content" 
              android:layout_width="wrap_content" 
              android:layout_alignParentTop="true"
              android:layout_alignParentRight="true">
    </ZoomControls>
    
    </RelativeLayout>
    

    This layout will make your zoomcontrols in top-right of the screen as defined by the attributes ,

    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    

    so basically you can align your views by nesting them in a Layout (like RelativeLayout , LinearLayout etc.)

    0 讨论(0)
提交回复
热议问题