有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java未在片段中的textview中显示全文

我在Eclipse中开发了一个Android应用程序,我正在使用framelayout作为我的fragment的容器。。。而且fragment没有显示全文。。。一半的文字被隐藏。。。 请帮帮我。。。!!! 先谢谢你

主活动。xml`

    <LinearLayout
            安卓:layout_width="match_parent"
            安卓:layout_height="200dp"
            安卓:orientation="vertical">

        <ScrollView
            安卓:id="@+id/scrollView2"
            安卓:layout_width="match_parent"
            安卓:layout_height="match_parent" >


                <FrameLayout
    安卓:id="@+id/fragment_place"
    安卓:layout_width="match_parent"
    安卓:layout_height="match_parent"

    安卓:focusable="true"/>

        </ScrollView>
  `

你四处走动。xml

    <LinearLayout 
    安卓:layout_width="fill_parent"
    安卓:layout_height="fill_parent"
    安卓:orientation="vertical"
    安卓:padding="10dp">

    <TextView
        安卓:id="@+id/textView1"
        安卓:layout_width="wrap_content"
        安卓:layout_height="wrap_content"
        安卓:text="About Us"
        安卓:textColor="#F44336"
        安卓:layout_gravity="center"
        安卓:textAppearance="?安卓:attr/textAppearanceLarge" 
        安卓:textSize="30dp"/>

    <TextView
        安卓:id="@+id/textView2"
        安卓:layout_width="wrap_content"
        安卓:layout_height="wrap_content"
         安卓:textColor="#2196F3"
        安卓:text="         Our vision is to interrelate the old and present students of college with each other and to develop a constant interaction among them.This also serves as a good opportunity to get the required career guidance to reach their future endeavours."
        安卓:textAppearance="?安卓:attr/textAppearanceLarge" />

    <View
        安卓:id="@+id/view1"
        安卓:layout_width="wrap_content"
        安卓:layout_height="9dp"
        />

    <TextView
        安卓:id="@+id/textView3"
        安卓:layout_width="wrap_content"
        安卓:layout_height="wrap_content"
        安卓:textColor="#2196F3"
        安卓:text="        We provide e-library to our students which compraises many number of e-books, projects and all fundamentals of electronics"
        安卓:textAppearance="?安卓:attr/textAppearanceLarge" />


    <View
        安卓:id="@+id/view2"
        安卓:layout_width="wrap_content"
        安卓:layout_height="9dp"
        />

    <TextView
        安卓:id="@+id/textView4"
        安卓:layout_width="wrap_content"
        安卓:layout_height="wrap_content"
         安卓:textColor="#2196F3"
        安卓:text="        We automized our students internal/external marks system so, every student can log on to his account and get his/her result at any time after the results are out"
        安卓:textAppearance="?安卓:attr/textAppearanceLarge" />

</LinearLayout>

原始片段是Original 但接下来的输出是output 剩下的部分不见了 提前谢谢


共 (2) 个答案

  1. # 1 楼答案

    请试试这个。保持主要活动。xml就是这样。如果是碎片的话。xml将根视图设置为ScrollView,只需在下面添加一个视图即可

                    <ScrollView
                            android:id="@+id/scroll"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                              android:fitsSystemWindows="true"    >
    
    
                       <LinearLayout 
               android:layout_width="match_parent"
                         android:layout_height="match_parent"
                android:orientation="vertical"
                android:padding="10dp">
    
                <TextView
                    android:id="@+id/textView1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="About Us"
                    android:textColor="#F44336"
                    android:layout_gravity="center"
                    android:textAppearance="?android:attr/textAppearanceLarge" 
                    android:textSize="30dp"/>
    
                <TextView
                    android:id="@+id/textView2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                     android:textColor="#2196F3"
                    android:text="         Our vision is to interrelate the old and present students of college with each other and to develop a constant interaction among them.This also serves as a good opportunity to get the required career guidance to reach their future endeavours."
                    android:textAppearance="?android:attr/textAppearanceLarge" />
    
                <View
                    android:id="@+id/view1"
                    android:layout_width="wrap_content"
                    android:layout_height="9dp"
                    />
    
                <TextView
                    android:id="@+id/textView3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#2196F3"
                    android:text="        We provide e-library to our students which compraises many number of e-books, projects and all fundamentals of electronics"
                    android:textAppearance="?android:attr/textAppearanceLarge" />
    
    
                <View
                    android:id="@+id/view2"
                    android:layout_width="wrap_content"
                    android:layout_height="9dp"
                    />
    
                <TextView
                    android:id="@+id/textView4"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                     android:textColor="#2196F3"
                    android:text="        We automized our students internal/external marks system so, every student can log on to his account and get his/her result at any time after the results are out"
                    android:textAppearance="?android:attr/textAppearanceLarge" />
        <View
                    android:layout_width="match_parent"
                    android:layout_height="25dp"/>
     </LinearLayout>
                        </ScrollView>
    
    Hope it will help.
    
  2. # 2 楼答案

    像这样试试
    主要活动。xml()

     <ScrollView
                android:id="@+id/scrollView2"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fillViewport="true" >
    
    
            <FrameLayout
                 android:id="@+id/fragment_place"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent" 
                 android:focusable="true"/>
    
            </ScrollView>