mobimaks
@mobimaks

Как сделать TextView и ExpandableListView с прозрачным NavBar-ом?

Хочу сделать такое приложение с прозрачным NavBar-ом.
LxqXTRP.png

Но если параметр windowTranslucentNavigation = true, то TextView уползает вверх.
Screenshot_2014-03-23-13-33-11.png

Код разметки:
main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">

    <fragment 
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:id="@+id/elvMainFragment"
              android:name="com.example.ExpListView_Events.FragmentExpListView"
              tools:layout="@layout/elv_fragment" />

</LinearLayout>


elv_fragment.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">

    <TextView 
              android:layout_width="fill_parent"
              android:layout_height="30dp"
              android:id="@+id/tvMainText"
              android:background="@android:color/holo_orange_dark"
              android:textColor="@android:color/white"
              android:textSize="18dp"
              android:text="Hello!"
              android:gravity="center" />

    <ExpandableListView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@android:id/list"
            android:fitsSystemWindows="true"
            android:clipToPadding="false" />

</LinearLayout>


style.xml
<resources>
    <style name="MyTheme" parent="android:Theme.Holo">
        <item name="android:windowTranslucentNavigation">true</item>
        <item name="android:actionBarStyle">@style/ActionTheme</item>
    </style>

    <style name="ActionTheme" parent="android:style/Widget.Holo.ActionBar">
        <item name="android:background">@android:color/holo_green_dark</item>
    </style>
</resources>
  • Вопрос задан
  • 2832 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы