11

के साथ एक्शनबार के पीछे छिपा हुआ है पारदर्शी नेविगेशन और स्टेटस बार (एपीआई लेवल 1 9) का उपयोग करते समय मुझे अपने स्वाइप रीफ्रेशलाइट को दृश्यमान बनाने में कुछ परेशानी हो रही है। यही कहना है, वर्तमान में स्टेटस बार (स्क्रीन के शीर्ष पर) के तहत, जब मैं इसे एक्शनबार के नीचे रखना चाहता हूं।स्वाइप रिफ्रेश लयआउट पारदर्शी स्टेटस बार

ListView अपेक्षित के रूप में काम कर रहा है। यही है, सामग्री नेविगेशन बार के पीछे ठीक से दिखाया गया है, और स्टेटस बार, या एक्शनबार के नीचे छिपा नहीं है।

यह कहा जा रहा है कि, यदि मैं एंड्रॉइड जोड़ता हूं: fitsSystemWindows = "true" प्रॉपर्टी मेरे सापेक्ष लेआउट में, SwipeRefreshLayout ठीक से काम करता है। लेकिन, ऐसा करने से मेरी सूचीदृश्य पारदर्शी नेविगेशन बार के नीचे दिखाई नहीं देता है। इसके बजाए, नेविगेशन बार बस मेरी पृष्ठभूमि का रंग हैं, और मेरी सूचीदृश्य से सामग्री को इसके अंतर्गत दिखाने की अनुमति न दें।

मैं सूची दृश्य कैसे देख सकता हूं कि यह अभी कैसे है, और मेरे स्वाइप रीफ्रेशलाइट को भी दिखने के लिए (स्क्रीन के शीर्ष पर स्टेटस बार के नीचे छुपाए जाने के बजाय) प्राप्त करने के लिए कैसे मिल सकता है?

<android.support.v4.widget.DrawerLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:id="@+id/drawer_layout" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

     <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:paddingTop="10dp" 
      android:background="#ccc" 
      android:clipToPadding="false"> 

      <android.support.v4.widget.SwipeRefreshLayout 
       android:id="@+id/swipe_container" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"> 

      <FrameLayout 
       android:id="@+id/container" 
       android:paddingLeft="@dimen/activity_horizontal_margin" 
       android:paddingRight="@dimen/activity_horizontal_margin" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:background="#ccc"> 

       <ListView 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:id="@+id/listView" 
        android:paddingTop="10dp" 
        android:fitsSystemWindows="true" 
        android:clipToPadding="false" 
        android:divider="@android:color/transparent" 
        android:layout_gravity="left|top" /> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:textAppearance="?android:attr/textAppearanceLarge" 
        android:text="No Internet Connection" 
        android:id="@+id/noInternet" 
        android:textColor="@android:color/secondary_text_light" 
        android:layout_gravity="center" /> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:textAppearance="?android:attr/textAppearanceMedium" 
        android:text="Pull To Refresh" 
        android:translationY="20dp" 
        android:id="@+id/nointernetSub" 
        android:textColor="@android:color/secondary_text_light" 
        android:layout_gravity="center" /> 

      </FrameLayout> 

      </android.support.v4.widget.SwipeRefreshLayout> 

     </RelativeLayout> 

    <fragment android:id="@+id/navigation_drawer" 
     android:layout_width="@dimen/navigation_drawer_width" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:name="com.package.app.NavigationDrawerFragment" 
     tools:layout="@layout/fragment_navigation_drawer" /> 

</android.support.v4.widget.DrawerLayout> 
+1

यह अपने प्रश्न के बाद से एक लंबा समय हो गया है, लेकिन हो सकता है आप अभी भी एक जवाब की जरूरत है:

नीचे मेरी लेआउट है। इस पर एक नज़र डालें: http://stackoverflow.com/questions/24413680/swiperefreshlayout-behind-actionbar – Naroh

उत्तर

3

मैं एक मार्जिन का उपयोग कर की सिफारिश करेंगे

android:layout_marginTop="?android:attr/actionBarSize" 
संबंधित मुद्दे