Android 网格布局溢出屏幕

Android 网格布局溢出屏幕,android,android-gridlayout,Android,Android Gridlayout,所以我是android新手,一直在尝试在网格布局中排列文本视图。我遇到的问题是文本溢出屏幕。我已经研究过了,但我能得到的唯一解决方案是使用安卓:layou\u columnWeight;不幸的是,我正在使用API19,但我知道直到API21才支持该属性。我能在这里得到一些帮助吗 为了您的方便,我提供了快照和.xml代码。谢谢 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:app="http://schema

所以我是android新手,一直在尝试在网格布局中排列文本视图。我遇到的问题是文本溢出屏幕。我已经研究过了,但我能得到的唯一解决方案是使用安卓:layou\u columnWeight;不幸的是,我正在使用API19,但我知道直到API21才支持该属性。我能在这里得到一些帮助吗

为了您的方便,我提供了快照和.xml代码。谢谢

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">

<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="2"
    android:background="#5B2C6F"
    tools:context="org.acfmission.allchristiansfellowshipmission.MainActivity">

    <ImageView
        android:id="@+id/logo"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:src="@drawable/logo"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:scaleType="fitCenter"/>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toRightOf="@id/logo"
        app:layout_constraintTop_toTopOf="parent"
        tools:layout_editor_absoluteY="182dp"
        tools:layout_editor_absoluteX="0dp">

        <TextView
            android:id="@+id/logo_text_1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toRightOf="@+id/logo"
            app:layout_constraintTop_toTopOf="parent"
            android:text="All Christians"
            android:fontFamily="serif"
            android:textColor="#FDFEFE"
            android:textColorHighlight="#979A9A"
            android:textSize="20sp" />

        <TextView
            android:id="@+id/logo_text_2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toRightOf="@+id/logo"
            app:layout_constraintTop_toBottomOf="@+id/logo_text_1"
            android:text="Fellowship Mission"
            android:layout_below="@id/logo_text_1"
            android:fontFamily="serif"
            android:textColor="#FDFEFE"
            android:textColorHighlight="#979A9A"
            android:textSize="18sp" />

    </LinearLayout>



</android.support.constraint.ConstraintLayout>

<RelativeLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="10"
    tools:context="org.acfmission.allchristiansfellowshipmission.MainActivity">

    <ImageView
        android:contentDescription="logo"
        android:src="@drawable/cathedral"
        android:scaleType="centerCrop"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <GridLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:rowCount="7"
        android:columnCount="2">

            <TextView
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="About"
                android:textSize="30sp"/>

            <TextView
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:text="A Caring Church, committed to Global Missions and Evangelisim, Discipleship and Societal Transformation"
                android:textSize="20sp" />

            <TextView
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="Vision"
                android:textSize="30sp"/>

            <TextView
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:text="To Raise Christ-like Disciples, who will be agents of transformation in the wold"
                android:textSize="20sp"/>

            <TextView
                android:text="Mission"
                android:textSize="30sp"/>

            <TextView
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="To bring people Jesus and MEMBERSHIP in His family, develop them to Christ-like MATURITY, equip them for their MINISTRY in the church, and life MISSION in the earth, in order to MAGNIFY God's name"
                android:textSize="20sp"/>

            <TextView
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="Social"
                android:textSize="30sp"/>

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                    <ImageView
                        android:id="@+id/facebook"
                        android:layout_height="wrap_content"
                        android:layout_width="wrap_content"
                        android:src="@drawable/facebook"/>

                    <TextView
                        android:layout_height="wrap_content"
                        android:layout_width="wrap_content"
                        android:text="acfmonline"
                        android:layout_toRightOf="@id/facebook"/>

                    <ImageView
                        android:id="@+id/twitter"
                        android:layout_height="wrap_content"
                        android:layout_width="wrap_content"
                        android:src="@drawable/twitter"
                        android:layout_below="@id/facebook"/>

            </RelativeLayout>

        <TextView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="Address"
            android:textSize="30sp"/>
        <TextView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="Address"
            android:textSize="20sp"/>

        <TextView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="Phone"
            android:textSize="30sp"/>

        <TextView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="Structure"/>

        <TextView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="Structure"
            android:textSize="30sp"/>

    </GridLayout>

</RelativeLayout>


非常感谢,我已经添加了内容,但我的问题仍未解决。网格仍然溢出屏幕。我需要更多的帮助!你能发布更新后的xml布局吗?我不得不切换到表布局。它解决了这个问题。非常感谢你的帮助!:)非常感谢,我已经做了补充,但是我的问题仍然没有解决。网格仍然溢出屏幕。我需要更多的帮助!你能发布更新后的xml布局吗?我不得不切换到表布局。它解决了这个问题。非常感谢你的帮助!:)