2016-03-31 18 views
0

Uygulamamda navigasyon çekmece aktivitesini (Materail Design) kullanıyorum ve bir Fragmanda bir web görüntüüm var. Gezinme, web görüntüsünü sorunsuz bir şekilde yükler. Ama ben web görünümünde dikey olarak kaydırılamıyor, yatay olarak yapabilirim. Horbontal kaydırma üzerinde dikey kaydırma çubuğunu görebilir, ancak işlevsel değil. İşte android navigation drawer material design webview dikey kaydırma yok

Fragment XML kodu

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/colorDefaultGray" 
    tools:context="com.cell.cell.fragments.MainWebViewFragmant"> 

    <WebView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/webViewMainWebview" 
     /> 

    <ProgressBar 
     style="?android:attr/progressBarStyleLarge" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:id="@+id/progressBar" 
     android:layout_gravity="center" /> 

</FrameLayout> 

app_bar_main.xml

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:context="com.cell.cell.MainActivity"> 

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

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      app:popupTheme="@style/AppTheme.PopupOverlay" /> 

     <FrameLayout 
      android:id="@+id/fragment_container" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"></FrameLayout> 

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

    <!--<include layout="@layout/content_main" />--> 


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

Böyle NestedWebView olarak, farklı bir çözüm denenmiş ve NestedScrollview içine webview etiketi koymak için çalıştı, ama hiçbir şans. peşin

cevap

1

Sen yanlışlıkla AppBarLayout daki FrameLayout tamamlanmakta bu

teşekkür için bir çözüm sağlamak AppBarLayout altında sizin FrameLayout taşıyın.

Peki, ne oluyor AppBarLayout WebView yerine kaydırma olayınızı alıyor.

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

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

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      app:popupTheme="@style/AppTheme.PopupOverlay" /> 
    </android.support.design.widget.AppBarLayout> 

    <!-- Move your FrameLayout outside the AppBarLayout --> 
    <FrameLayout 
      android:id="@+id/fragment_container" 
      app:layout_behavior="@string/appbar_scrolling_view_behavior" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"/> 


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

Sonra kitkat cihazlarda, durum çubuğu O durum o Lollipop cihazlarda çalışır önünü boyama hayır, bu varsayılan davranıştır var kitkat içinde AppBarLayout etiketi – user3421325

+0

içine eklenen y var gizler. –

+0

Denedim, ancak uygulama durumu çubuğu ekranı doldurur ... Fragman – user3421325