试图找出克服这个小问题。在顶部和两个视图之间放置视图
下面的左侧是我试图为应用程序实现的视图示例。右侧是我将要结束的观点。
在我的XML模拟了,我已经决定要使用RelativeLayout
,但我不能让TextView
到顶部和底部的观点之间为中心。
仅供参考这里是我的XML代码represenation:
<RelativeLayout
android:layout_width:"match_parent"
android:layout_height:"wrap_content">
<ImageView
android:id="@+id/BlackImage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:layout_alightParentTop="true"
android:layout_centerHorizontal="true"/>
<ImageView
android:id="@+id/RedImage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:layout_below="@+id/BlackImage"
android:layout_centerHorizontal="true"/>
<TextView
android:id="@+id/TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/BlackImage"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
任何想法,我缺少的是什么,或者如何改变让我想要什么?
我想我会尝试'FrameLayout'的是,由于'RelativeLayout'相当用于沿着边缘对齐的视图。无论如何,你可以尝试一个负边距或填充。 – Trinimon
尝试下面的链接希望它会帮助你: - –
duggu