如何在xml中移动图像视图

Xlerone

我是android开发的新手,我正在使用eclipse java开发一个应用程序。我的问题是我想将图像视图或按钮之类的元素定位到Adobe Flash中想要的任何位置,我该怎么做。相对布局将元素相对于其他对象放置。我是否应该更改相对布局以及应将其更改为什么?(我的意思是哪种布局)谢谢,这是我的代码。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ff8D8D8D"
    tools:context="com.example.deniz.MainActivity" >
    <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:scaleType="fitXY" android:src="@drawable/back"/>
    <ImageView android:id="@+id/close" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:onClick="close_app" android:src="@drawable/exit"/>
    <ImageView android:id="@+id/new_project" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="22dp" android:layout_marginTop="24dp" android:onClick="open_new" android:src="@drawable/buttonm"/>
    <ImageView android:id="@+id/little" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/new_project" android:layout_below="@+id/new_project" android:layout_marginLeft="16dp" android:layout_marginTop="18dp" android:src="@drawable/buttonm"/>
    <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_marginBottom="16dp" android:layout_toRightOf="@+id/new_project" android:scaleType="fitCenter" android:src="@drawable/buttonm"/>

</RelativeLayout>
斜杠G

我不是经验丰富的Android开发人员(我的声誉清楚地反映了这一点),但是凭借我的谦虚经验,我想我会为您解决问题。

您应该坚持使用RelativeLayout并结合使用以下任何一种功能:

不推荐或不常用的ViewGroup之一就是AbsoluteLayout,它在定义上正是您所需要的。

尽管最常用的布局(例如LinearLayout,RelativeLayout)具有实现大多数设计的足够可能性,但我希望我的回答能帮助您实现目标。

愉快的发展!

干杯!

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章