簡體   English   中英

在片段android的textview中不顯示全文

[英]not showing full text in textview in a fragment android

我在Eclipse開發了一個Android應用,並且我將framelayout用作fragment的容器...而該fragment未顯示全文...一半的文本處於隱藏狀態...請幫幫我... !!! 提前致謝...

activty_main.xml

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

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


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

    android:focusable="true"/>

        </ScrollView>
  `

fragment_about.xml

    <LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_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" />

</LinearLayout>

原始片段是原始的,但輸出即將輸出 ,其余部分丟失

請嘗試一次。 保持activity_main.xml不變。 在fragment_about.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.

這樣嘗試
main_activity.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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM