У меня есть экран, который использует вкладки в моем приложении для Android. Существует строка (например, граница), которая показывает между tabwidget и framelayout. Я хочу избавиться от этой линии, но не могу найти, что это такое. Я решил, что это часть FrameLayout, установив видимость. См. Следующий код:
<?xml version="1.0" encoding="utf-8"?>
<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">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fb8c10"
>
<ImageView
android:id="@+id/img_confirm_header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/confirm_header"
/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="0dip"
android:background="#fb8c10"
android:tabStripEnabled="false"
/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/tab_bg"
/>
</LinearLayout>
</TabHost>
Это ссылка текущего макета и то, что я пытаюсь сделать http://img441.imageshack.us/g/screenshot20110116at513.png/
Оранжевый макет - это мое приложение, а серый - это то, что я пытаюсь сделать.
Обратите внимание, как на сером снимке экрана вкладка втекает в кадр.
Извинения за ссылки, я еще не могу отправить изображения: p
Спасибо!
Мне удалось решить это, манипулируя z-индексом, используя относительный макет. Мне удалось позиционировать вкладки немного над рамкой. См. Код ниже:
<?xml version="1.0" encoding="utf-8"?>
<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">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fb8c10"
>
<ImageView
android:id="@+id/img_confirm_header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/tab_header"
/>
<RelativeLayout
android:id="@+id/widget77"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:layout_marginTop="33dip"
/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#fb8c10"
android:tabStripEnabled="true"
android:layout_above="@android:id/tabcontent"
android:layout_marginBottom="40dip"
/>
</RelativeLayout>
</LinearLayout>
</TabHost>
Сейчас я столкнулся с этой проблемой. Однако я также попытался удалить верхнюю границу FrameLayout. Я сделал это. но я не думаю, что это способ удалить верхнюю границу. в любом случае FYI,
Просто поместите TextView с белым фоном на границе и используйте AbsoluteLayout.
Например:
<AbsoluteLayout>
<TabHost
android:layout_x="0dip"
android:layout_y="5dip" ...>
<AbsoluteLayout android:padding="5dip" android:background="#ffffff">
<TabWidget/>
<FrameLayout ....
android:layout_x="0dip" android:layout_y="65dip" />
</AbsoluteLayout>
</TabHost>
<TextView
android:layout_width="fill_parent" android:layout_height="25dip"
android:layout_x="0dip" android:layout_y="65dip"
android:background="#ffffff"/>
</AbsoluteLayout>