【发布时间】:2016-04-11 11:54:33
【问题描述】:
我几乎尝试了从Gravity 到alignParentTop 和layout_above 的所有方法,但这里似乎没有任何效果。
我有一个ImageView 和一个TextView 我正在使用ViewPager 来显示不同的图像及其各自的text。
问题在于,它在顶部显示Text,在其后显示图像。
我希望它显示Image,并在其下方显示TextView。
这是我添加以下xml后得到的结果
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="200dp"
/>
<TextView
android:id="@+id/image_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="Image Text"
/>
</RelativeLayout>
请指导我如何将Text 放在Image 之后
【问题讨论】:
标签: android xml android-layout android-studio