我不能对齐图像垂直centered.What,我在这里丢失?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_marginTop="35dp"
android:layout_height="fill_parent">
<Spinner
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/moviesSpinner"
android:prompt="@string/movie_prompt" />
<ImageView
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_alignParentRight="true"
android:src="@drawable/Arrowcircled"
android:layout_width="20dp"
android:layout_height="20dp"
android:id="@+id/imageView1" />
</RelativeLayout>发布于 2016-03-24 07:51:26
如果添加大小为spinner的父spinner,则可以这样做
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="35dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Spinner
android:id="@+id/moviesSpinner"
android:layout_width="match_parent"
android:layout_height="30dp"
android:prompt="@string/movie_prompt"/>
<ImageView
android:id="@+id/imageView1"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:src="@drawable/bemoir_splash3"/>
</RelativeLayout>
</RelativeLayout>发布于 2016-03-24 07:50:34
试试!!
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_marginTop="35dp"
android:layout_height="fill_parent">
<Spinner
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/moviesSpinner"
android:prompt="@string/movie_prompt" />
<ImageView
android:src="@drawable/Arrowcircled"
android:layout_width="20dp"
android:layout_centerInParent="true"
android:layout_below="@+id/moviesSpinner"
android:layout_height="20dp"
android:id="@+id/imageView1" />
https://stackoverflow.com/questions/36195331
复制相似问题