5

मुझे नहीं पता क्यों, लेकिन ऐसा लगता है कि जब टूलबार पतन हो जाता है, तो दूसरी स्टेटस बार दिखाई देता है।टूलबार लेआउट स्टेटस बार समस्या को संकुचित करना

मैंने सभी घटकों में android:fitsSystemWindows="true" का उपयोग किया, क्योंकि इसके बिना टूलबार स्टेटस बार से बाहर आया।

यहाँ कुछ छवियों बेहतर व्याख्या करने के लिए कर रहे हैं: Images

मैं ऐसी बात कभी नहीं देखा है, और मैं उन सभी की कोशिश की लेकिन मैं इसे कैसे हल करने के लिए पता नहीं है। मुझे नेट पर कुछ भी नहीं मिला।


यहाँ कोड:

लेआउट:

<android.support.design.widget.CollapsingToolbarLayout 
    android:id="@+id/collapsing_toolbar" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    app:statusBarScrim="?attr/colorPrimaryDark" 
    app:contentScrim="?attr/colorPrimary" 
    app:layout_scrollFlags="scroll|exitUntilCollapsed" > 

    <ImageView 
     android:id="@+id/photo_actor" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:scaleType="centerCrop" 
     android:fitsSystemWindows="true" 
     app:layout_collapseMode="parallax" /> 
    <View 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_collapseMode="parallax" 
     android:fitsSystemWindows="true" 
     android:background="@drawable/background_protection" /> 
    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:fitsSystemWindows="true" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     app:layout_collapseMode="pin" /> 
</android.support.design.widget.CollapsingToolbarLayout> 
</android.support.design.widget.AppBarLayout> 
<android.support.v4.widget.NestedScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"> 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:padding="8dp" 
     android:orientation="vertical"> 
     <WebView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@null" 
      android:id="@+id/webview_bio"/> 
    </LinearLayout> 
    </android.support.v4.widget.NestedScrollView> 

गतिविधि onCreate:

Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar); 
    setSupportActionBar(toolbar); 

    CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar); 
    if(collapsingToolbarLayout!=null){ 
     collapsingToolbarLayout.setTitle(advm.getName()); 
    } 

शैलियाँ : (एक मैं वर्तमान गतिविधि में उपयोग पीछे नहीं है)

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/colorAccent</item> 
    <item name="android:textColor">@color/text_color</item> 
</style> 

<style name="AppTheme.NoActionBar"> 
    <item name="android:windowDrawsSystemBarBackgrounds">true</item> 
    <item name="android:windowTranslucentNavigation">true</item> 
    <item name="android:statusBarColor">@android:color/transparent</item> 
    <item name="windowActionBar">false</item> 
    <item name="windowNoTitle">true</item> 
</style> 

उत्तर

1

यह एक अतिरिक्त गद्दी अपने fitSystemWindows पर CollapsingToolbarLayout द्वारा जोड़ा() लगता है। मुझे लगता है कि आपको स्थिर स्तर लेआउट के रूप में स्थिर लेआउट प्राप्त करने के लिए थीम स्तर (API19 +) पर भी <item name="android:windowTranslucentStatus">true</item> सक्षम करना होगा। उपरोक्त कोड में

android:fitsSystemWindows="true" 

मुझे लगता है कि यह हो जाएगा::,

<android.support.design.widget.AppBarLayout 
android:fitsSystemWindows="true" 
... 
> 
... 
</android.support.design.widget.AppBarLayout> 

गुड लक '

0

जो कोई भी इस मुद्दे का सामना कर रहा है, इस माता पिता तत्वों में जोड़ें।

संबंधित मुद्दे