M
M
mobimaks2014-03-23 14:55:17
Android
mobimaks, 2014-03-23 14:55:17

How to make TextView and ExpandableListView with transparent NavBar?

I want to make such an application with a transparent NavBar.
LxqXTRP.png
But if the parameter windowTranslucentNavigation = true , then the TextView crawls up.
Screenshot_2014-03-23-13-33-11.png
Markup code:
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>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question