java - ScrollView 剪切 TextView 中的文字

标签 java android scrollview

我的 ScrollView 布局有问题:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_gravity="center_horizontal|center_vertical"
        android:id="@+id/editRelativeLayout"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
            android:id="@+id/typeTextView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="Large Text"
            android:textAppearance="?android:attr/textAppearanceLarge" />

    </LinearLayout>
</ScrollView>

问题是当我有很多文本要在 TextView 中显示时,TextView2 消失了......知道如何解决它吗?

最佳答案

我已经解决了删除行的问题:

android:layout_gravity="center_horizontal|center_vertical"

关于java - ScrollView 剪切 TextView 中的文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13313762/

相关文章:

Android - ScrollView 内的 TabHost

java - OpenJDK 10 拒绝所有 SSL 证书

javascript - 如何检测Android浏览器隐藏软键盘事件?

android - ScrollView 中的 WebView 每次向上滑动 React Native Android 时调用 refreshControl

java - 从全屏视频返回到 webview.java.lang.IllegalStateException : You must call removeView() on the child's parent first 时发生崩溃

java - Android:为 recyclerView 项目添加边框和舍入

ios - SwiftUI:ScrollView 偏移滚动内容

java - 如何在 PDFTextStripperByArea 中定义区域?

java - 设置Java环境变量?

java - 工厂设计模式的实现