现在,我的布局看起来像下面两个图像之一,具体取决于屏幕的确切大小。一个机器人,玩游戏!按钮在顶部,另一方面,版权文本在顶部。
我要做的是在 adview 和顶部文本框/布局的较高位置之间放置一个图像。根据不同的屏幕尺寸,顶部的条目可能会有所不同。我想根本没有这个问题......我知道如何将它放在图像视图下方,但不将它放在两个项目之上。
到目前为止,我已经尝试了一个包含底部变量的 relativeLayout,并告诉图像高于它,但低于 AdView。问题是,RelativeView 的顶部清晰到顶部,尽管它被设置为 wrap_content 并且以下值都没有达到那么高。
我也考虑过将文本的顶部与按钮的顶部对齐,反之亦然,但我在脑海中看到了一个可能丑陋的界面,其中顶部按钮可能更大,或者是版权文本被遮盖。
所以,我正在寻找两种解决方案之一。一种告诉我的图像高于 2 项、按钮和文本的方法,或者某种包装上下文的方法,这样我就可以高于包装的值。
这是我测试过的相关 XML 代码。
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<com.google.ads.AdView android:id="@+id/adView" ads:loadAdOnCreate="true" ads:adSize="BANNER" ads:adUnitId="@string/admob_unit_id" android:layout_width="wrap_content" android:layout_height="wrap_content" ></com.google.ads.AdView>
<ImageView android:src="@drawable/start_logo" android:gravity="center" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/logo_view" android:layout_below="@+id/adView" android:layout_above="@+id/buttons_copyright"></ImageView>
<RelativeLayout android:id="@+id/buttons_copyright" android:layout_width="fill_parent" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:layout_alignParentTop="false" android:layout_height="wrap_content">
(NOTE: LOTS OF STUFF GOES HERE)
</RelativeLayout>
</RelativeLayout>