Monday, 15 June 2015

android - ViewpagerIndicator hides the tabs content in ScrollView -


I am using the 'ViewPagerIndicator' library to get the tabs in between layouts. 'ViewPager' in 'TabPageIndicator' and 'scrollview'.

Here are my problems tabs, but the content view is invisible. I found 'HierarchyViewer' using this.

My layout is as follows

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Scrollview xmlns: Android = "http://schemas.android.com/apk/res/android" Android: layout_width = "match_parent" Android: layout_height = "match_parent" android: background = "@color / white_color" android: FillViewport = "True" & gt; & Lt; ViewAnimator Android: id = "@ + id / view__root" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: orientation = "vertical" & gt; & Lt; LinearLayout style = "@ style / linerlayout. Vertical" & gt; & Lt; Relative layout ..... & gt; & Lt; ImageView ..... / & gt; & Lt; TextView .... / & gt; & Lt; / RelativeLayout & gt; & Lt; LinearLayout ...... & gt; & Lt; TextView ..... / & gt; & Lt; / LinearLayout & gt; & Lt; LinearLayout ..... & gt; & Lt; TextView .... / & gt; & Lt; / LinearLayout & gt; & Lt; LinearLayout ........ & gt; & Lt; Com.google.android.maps.MapView ........ / & gt; & Lt; / LinearLayout & gt; & Lt; Relative layout ....... & gt; & Lt; ImageView ..... / & gt; & Lt; ImageView ...... / & gt; & Lt; ImageView ...... / & gt; & Lt; ImageView .... /> & Lt; / RelativeLayout & gt; & Lt; LinearLayout ...... & gt; & Lt; List view ....... / & gt; & Lt; / LinearLayout & gt; & Lt; Android: paddingLeft = "10dp" Android: paddingRight = "10dp" & gt; LinearLayout Android: ID = "@ + id / layout_viewpageindicator" Android: Orientation = "Vertical" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" & Lt; Com.viewpagerindicator.TabPageIndicator Android: id = "@ + id / indicator_1" Android: layout_height = "match_parent" android: layout_width = "match_parent" /> & Lt; Android.support.v4.view.ViewPager android: id = "@ + id / pager_1" Android: layout_width = "fill_parent" android: layout_height = "fill_parent" /> & Lt; / LinearLayout & gt; & Lt; / LinearLayout & gt; & Lt; / ViewAnimator & gt; & Lt; / Scrollview & gt;   

Please help me anyway Thanks in advance.

You should add android: fillViewport = "true" to your ScrollView and Set its layout_height to "fill_parent" .

No comments:

Post a Comment