-1

I already tried to use the solution rom here

Rigth now it's a ScrollView. Neither of these possibilities will let me Scroll the text.

It minSDK is Version 8. It still has to be able to run on android 2.2.1.

I also included Following Support libaries in my build.gradle

compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:support-v4:23.4.0'

My FragmentOne.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<ScrollView
android:id="@+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
    android:text="lorem ipsum .. (500 Words)"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:gravity="center"
    android:id="@+id/tvStatus"/>

And my FragmentOne.java:

package com.kaba.apps.apptemplate.fragment;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class FragmentOne extends Fragment
{
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View fragmentView = inflater.inflate(R.layout.fragment_one, container, false);
        fragmentView.setBackgroundColor(Color.DKGRAY);

        TextView tvStatus = (TextView)fragmentView.findViewById(R.id.tvStatus);
        tvStatus.setTextColor(Color.WHITE);
//        tvStatus.setText("I am fragment one");
//        tvStatus.setMovementMethod(new ScrollingMovementMethod());

        return fragmentView;
    }


}
Community
  • 1
  • 1
chris2701
  • 13
  • 3

2 Answers2

1

Because you don't have enough content in TextView or Add enough views inside scrollview

Amey Jahagirdar
  • 455
  • 1
  • 4
  • 14
  • I just cutted the content inside my TextView. I thought it will not be the best idea to post 2 Sites of lorem ipsum. – chris2701 Oct 25 '16 at 14:50
  • So the TextView is even longer then the Screen on my S7. ANd the App will be running und maximum VGA resolution. Thats why i'm asking here, the thing just wont scroll even that it is big enough – chris2701 Oct 25 '16 at 15:21
0

After days of searching i finally found the mistake in my files

In the app_bar_main.xml you have do be sure, that your include / layout is beneath the </android.support.design.widget.AppBarLayout> in any other case you will experience the same problems as me.

app_bar_main.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".TemplateActivity">

<android.support.design.widget.AppBarLayout
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:gravity="center"
        app:popupTheme="@style/AppTheme.PopupOverlay">

        <LinearLayout
            android:id="@+id/main_toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="vertical">

            <TextView
                android:id="@+id/main_toolbar_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </LinearLayout>
    </android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>

    <include layout="@layout/fragment_one"/>
</android.support.design.widget.CoordinatorLayout>

and here it is like it should not be:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".TemplateActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            android:gravity="center"
            app:popupTheme="@style/AppTheme.PopupOverlay">

            <LinearLayout
                android:id="@+id/main_toolbar_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/main_toolbar_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />
            </LinearLayout>
        </android.support.v7.widget.Toolbar>

    <include layout="@layout/fragment_one"/>

    </android.support.design.widget.AppBarLayout>

</android.support.design.widget.CoordinatorLayout>
chris2701
  • 13
  • 3