मुझे नहीं पता क्यों, लेकिन ऐसा लगता है कि जब टूलबार पतन हो जाता है, तो दूसरी स्टेटस बार दिखाई देता है।टूलबार लेआउट स्टेटस बार समस्या को संकुचित करना
मैंने सभी घटकों में 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>