Я пытаюсь выровнять рекламный макет в верхней части макета вкладки, и мне не везет. Кажется, застрял, выравнивая внизу. Я настроил расположение вкладок, чтобы вкладки находились внизу экрана:
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:id="@+id/adLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
</RelativeLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp"
>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="0dp"
/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="23dp"
android:background="@drawable/tab_bg_selector"
android:layout_weight="0"
/>
</LinearLayout>
</TabHost>
Обновление:
Я исправляю это, я забыл, что я устанавливал выравнивание в коде, как это:
final RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
Как только я изменил ALIGN_PARENT_BOTTOM на ALIGN_PARENT_TOP, все заработало.