I’m a noob to android and i am trying to switch 4 views in a view flipper. My first view is a listview and it flips without any problems. However, none of my webviews are flipping. the viewflipper works fine with other child views, such as buttons and imageviews just not webviews. Any help resolving this is greatly appreciated.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tab2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical" >
<ViewFlipper
android:id="@+id/viewFlipper1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+id/ListViewId"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000" >
</ListView>
<WebView
android:id="@+id/webViewnews"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</WebView>
<WebView
android:id="@+id/webViewcoinshows"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</WebView>
<WebView
android:id="@+id/webViewyoutube"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</WebView>
</ViewFlipper>
Instead of using
ViewFlipperwhy don’t you useViewPager:android.support.v4.view.ViewPagerit’s easy to implement it and give you a better effect when flipping, and will work for sure, I’ve done it before. You can find the documentation here.