2017-01-13 11 views
1

バッテリーとネットワークのある一番上のバーは白い棒で表示されます。 これを修正する際にお手伝いください。 おかげバッテリーとネットワークのある一番上のバーは表示されません

は、それは私のxmlそれはここで、この

It should be like this

ようにする必要があり、この

It is coming like this

ようにするために働いている

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" > 

<android.support.design.widget.AppBarLayout 
    android:id="@+id/app_bar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/AppTheme.AppBarOverlay"> 

    <android.support.v7.widget.Toolbar 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="?attr/colorPrimary" 
     android:theme="?attr/actionBarTheme" 
     android:minHeight="?attr/actionBarSize" 
     android:id="@+id/toolbar2" 
     android:layout_weight="1" /> 

</android.support.design.widget.AppBarLayout> 

<!-- Editext for Search --> 
<EditText android:id="@+id/inputSearch" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:hint="Search products.." 
    android:inputType="textVisiblePassword"/> 

<!-- List View --> 
<ListView 
    android:id="@+id/list_view" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" /> 

</LinearLayout> 
+0

上記を確認してくださいapproidlayoutにandroid:theme = "@ style/AppTheme.AppBarOverlay"を追加してこれを削除し、 –

+0

あなたの 'v21/styles.xml'ファイルを投稿してください。 –

+0

最上位のバーが 'StatusBar'と呼ばれています –

答えて

2

修正をされて来ています私はCoordinatorLayoutに切り替えることです。すなわち

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true"> 

    <!-- your contents here --> 

</android.support.design.widget.CoordinatorLayout> 

CoordinatorLayoutの中にレイアウトの内容を移動します。またandroid:fitsSystemWindows="true"が必要ですが、fitSystemWindowsがtrueに設定されていなければ動作しませんでした。それが役に立てば幸い。

+0

これはうまくいきました。 Linear Layoutの使用上の問題とコーディネーターのレイアウトに役立った点についても説明できます –

+0

coordinate_layoutは、これらのappBarLayoutとToolbarの先行機能の親レイアウトです。 CoordinateLayoutは、素材デザインとさらにAPIバージョンで導入されています。これについて自分自身を勉強することをお勧めします。 –

関連する問題