Android : Scroll layout wouldn't show one of my views?

on Saturday, January 31, 2015


I want to have the following layout :


my layout


But when I run the code the first linear layout which contains a relative layout and an image is shown correctly. Then there is the "view pager" but it is not on the screen. and then there is a text box and a button which are there too.


So why my view pager is missing?



<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
tools:ignore="NestedWeights,ContentDescription" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="5" >

<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:src="@drawable/sp_page_name"
tools:ignore="ContentDescription" />

<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:padding="@dimen/product_views_horizontal_padding"
tools:ignore="NestedWeights" >
</RelativeLayout>
</LinearLayout>

<android.support.v4.view.ViewPager
android:id="@+id/pager_sharepoint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/TODO"/>

<TextView
android:id="@+id/sharepoint_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sharepoint_description"
tools:ignore="SelectableText" />
<ImageButton
android:id="@+id/sp_more_info"
android:layout_width="70dp"
android:layout_height="30dp"
android:background="@drawable/more_info_icon"
android:layout_gravity="left"
android:onClick="sp_more"/>

</LinearLayout>
</ScrollView>

0 comments:

Post a Comment