textview below imageview not displayed in small devices



I have a simple textview below an imageview in a viewpager :



<ImageView
android:id="@+id/imgMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_launcher" />

//THIS IS THE PROBLEM
<com.blazetama.skripsi.util.CustomTextView
android:id="@+id/txtMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="TextView" />


This is my layout code (the important part is the viewpager), the problem should be here :



<ImageView
android:id="@+id/imgHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/edittext_vertical_margin"
android:layout_marginLeft="@dimen/edittext_vertical_margin"
android:layout_marginRight="@dimen/edittext_vertical_margin"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/title_n_instruct" />

<LinearLayout
android:id="@+id/layoutViewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/indicatorMenu"
android:layout_below="@+id/imgHeader"
android:orientation="horizontal" >

<ImageView
android:id="@+id/imgLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.2"
android:scaleType="centerCrop"
android:src="@drawable/left"
android:visibility="invisible"/>

<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/edittext_vertical_margin"
android:layout_marginRight="@dimen/edittext_vertical_margin"
android:layout_weight="0.6" />

<ImageView
android:id="@+id/imgRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.2"
android:scaleType="centerCrop"
android:src="@drawable/right" />
</LinearLayout>

<com.viewpagerindicator.IconPageIndicator
android:id="@+id/indicatorMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />

<ProgressBar
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone" />


I already define the viewpager's height and its parent layout as wrap_content, however the textview below my imageview is not shown in small devices (320dp). The result is IconPageIndicator is below the imageview (no textview) instead of the textview below the imageview and the IconPageIndicator below the textview.


Please kindly help me, Thanks for your help.


No comments:

Post a Comment