Android 如何构建这样的布局?
我想用以下设计构建一个活动。到目前为止,我只使用相对和线性布局。 是否可以使用此组视图进行以下设计,或者我应该使用其他设计 我想在2号和3号形状上放置一些动画,但不是文本1和文本2。 我该怎么办?是否可以只在xml文件中进行设计,还是应该在java代码中进行一些工作?Android 如何构建这样的布局?,android,layout,Android,Layout,我想用以下设计构建一个活动。到目前为止,我只使用相对和线性布局。 是否可以使用此组视图进行以下设计,或者我应该使用其他设计 我想在2号和3号形状上放置一些动画,但不是文本1和文本2。 我该怎么办?是否可以只在xml文件中进行设计,还是应该在java代码中进行一些工作? *只有彩色部分是布局,数字和箭头不是布局的一部分。这就是我所做的,我使用了3个不可见视图来帮助我将图像视图放置在我想要的位置。 至于大小,我将使用dimens.xml和不同屏幕大小的不同值 <RelativeLayout
*只有彩色部分是布局,数字和箭头不是布局的一部分。这就是我所做的,我使用了3个不可见视图来帮助我将图像视图放置在我想要的位置。 至于大小,我将使用dimens.xml和不同屏幕大小的不同值
<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="@color/background" >
<View
android:id="@+id/center"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerInParent="true"
android:visibility="invisible" />
<view
android:id="@+id/up"
android:layout_width="1dp"
android:layout_height="1dp"
android:layout_above="@id/center"
android:layout_toRightOf="@id/center"/>
<view
android:id="@+id/down"
android:layout_width="1dp"
android:layout_height="1dp"
android:layout_below="@id/center"
android:layout_toLeftOf="@id/center"/>
<ImageView
android:id="@+id/p_button"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_above="@id/down"
android:layout_toLeftOf="@id/up"
android:src="@drawable/p"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/s_button"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_below="@id/up"
android:layout_toRightOf="@id/down"
android:src="@drawable/s"
tools:ignore="ContentDescription" />
我建议你发布你到目前为止所做的事情,以及你想要改变什么来实现你的需求。