Scroll view height problem in small phones

  • Replies:5
  • OpenNot stickiedUnanswered
  • Forum posts: 69

Sep 5, 2016 10:01:42 AM via Website

How to resolve the scrollview height problem in small devices??

  • Forum posts: 69

Sep 23, 2016 2:24:52 PM via Website

That wouldn't work...

  • Forum posts: 69

Sep 26, 2016 1:24:36 PM via Website

Here is my XML Code...

<?xml version="1.0" encoding="utf-8"?>

android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Variables"
    android:id="@+id/ch4.1"
    android:layout_marginTop="15dp"
    android:textColor="#3F51B5"
    android:gravity="center"
    android:textAllCaps="true"
    android:textSize="18dp"
    android:textStyle="bold" />

<ScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/scrollView7" >

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="7dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="1700dp"
            android:textColor="@color/content"
            android:text="@string/var_first"
            android:textSize="17dp"
            android:id="@+id/textView8" />
    </LinearLayout>
</ScrollView>

  • Forum posts: 207

Sep 27, 2016 1:46:03 PM via Website

Check if this can help you

xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.android_word.MainActivity" >

<TextView
    android:id="@+id/ch4.1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="15dp"
    android:gravity="center"
    android:text="Variables"
    android:textAllCaps="true"
    android:textColor="#3F51B5"
    android:textSize="18dp"
    android:textStyle="bold" />

<ScrollView
    android:id="@+id/scrollView7"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="7dp"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/textView8"
            android:layout_width="wrap_content"
            android:layout_height="1700dp"
            android:text="ashu"
            android:textSize="17dp" />
    </LinearLayout>
</ScrollView>

Also if not share the screenshot as well for better idea