设置Android的ZoomButtonsController对齐? [英] set Android ZoomButtonsController alignment?

查看:112
本文介绍了设置Android的ZoomButtonsController对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林在我的自定义视图实现ZoomButtonsController并一直在试图找出如何将其调整到屏幕的右下角(它对齐的底部中间默认情况下),但还没有任何运气。

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 bottom middle by default) but havent had any luck.

推荐答案

ZoomButtonsController可以在XML文件中定义,并且可以相应地定位,为例如

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>

由属性定义的这种布局将在屏幕的右上方你zoomcontrols,

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"

所以基本上可以通过它们嵌套在布局调整的意见(如RelativeLayout的,LinearLayout中等等。)

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

这篇关于设置Android的ZoomButtonsController对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆