我在 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,则将 Root View 作为ScrollView
,然后在下面添加一个 View ,即
<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.
关于java - android fragment 中的textview中不显示全文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36980397/