编写长文本以在android屏幕上显示,以便屏幕向下滚动 [英] writing long text to display on screen in android so that screen scoll down

查看:55
本文介绍了编写长文本以在android屏幕上显示,以便屏幕向下滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示2-3页长的文本,尝试使用滚动视图,但文本被截断,我是开发中的新手,请举个简单的例子,谢谢

I want to display text which is 2-3 pages long ,tried to use scroll view but text get cut off,i'm new in development,kindly give simple example,thanx

推荐答案

这将起作用,诀窍是在滚动视图中获取要滚动的内容.

This will work, the trick is to get what you want to scroll inside the scrollview.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

            <TextView
                android:id="@+id/textView1"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:text="@string/text" />

        </LinearLayout>
    </ScrollView>

</RelativeLayout>

这篇关于编写长文本以在android屏幕上显示,以便屏幕向下滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆