android


android navigation drawer material design webview no scrolling vertically


I am new to android , in my application am using navigation drawer activity (Materail Design) and have a webview in a Fragment . The Navigation loads webview without any problem . But i cannot scroll the webview vertically , i can do horizontally .I can see the vertial scroll bar on horzontal scroll , but not functional.
Here is the Fragment XML code
<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>
I tried different solution , such as NestedWebView and tried to put the webview tag inside NestedScrollview ,but no luck.
Please provide a solution for this
Thanks in advance
You are accidentally wrapping your FrameLayout in your AppBarLayout, move your FrameLayout underneath the AppBarLayout.
So what is happening is the AppBarLayout is taking your scroll event instead of the WebView.
<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>

Related Links

Android: Is it ok to have multiple handlers per thread
Android: Changing the windowBackground of PreferenceActivity causes weird effect
Android: Why would an event fail to post and what should you do if it doesn't?
Scrolling TextView in custom alert dialog
android market exclusion
Soft keyboard enter key event handle
Disable scrolling in listview
Notification flags have value -3
How can we make a process restart faster?
ANTLR and Android
Show Toast on SplashScreen Android
Eclipse's DDMS is not detecting device (Emulator)
Autocomplete data retrived via http request (not hardcded) when user type in textbox
Android media player(android.media.MediaPlayer) two music concurrently
Android, setSelected() and state_selected
weird permission issue while deleting android bookmarks

Categories

HOME
grok
api
merge
android-studio-2.2
rdbms
swt
camera
pdfbox
soa
babeljs
trac
lanczos
performancepoint
augeas
jquery-ui-sortable
pcl-crypto
octave
ycsb
pybossa
entitymanager
forgot-password
enterprise-miner
simpleitk
asciidoctor-pdf
dpdk
epsilon
game-theory
mat
rpgle
sinch
carrierwave
winpe
twiml
scatter3d
kudu
nested-lists
browser-extension
parse-tree
cd
android-augmented-reality
chef-solo
dcmtk
wmp
lpsolve
congestion-control
show-hide
facebook-social-plugins
automapper-5
rserve
tinymce-3
scalding
appdomain
cup
css-transforms
oozie-coordinator
google-photos
restore
i386
ng-grid
expectations
omniauth-facebook
tracker-enabled-dbcontext
database-relations
qt5.2
pypiserver
.bash-profile
jdk1.7
dulwich
branch-and-bound
matlab-deployment
dbaccess
iiop
teaspoon
raygun
kissfft
ios8-extension
high-resolution
http-patch
windows-phone-8-sdk
hidapi
scringo
windows-98
iboutlet
oracle-enterprise-linux
koken
cuteeditor
unattended-processing
collectionviewsource
mathematical-typesetting

Resources

Encrypt Message