android布局-scrollview don';不显示
我有一个包含EditText的ScrollView,但问题是它不能在模拟器和物理设备上正确显示。有人看到我的代码有问题吗 XML片段android布局-scrollview don';不显示,android,scrollview,Android,Scrollview,我有一个包含EditText的ScrollView,但问题是它不能在模拟器和物理设备上正确显示。有人看到我的代码有问题吗 XML片段 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height=
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:background="@drawable/background2"
tools:context="com.jack.cheng.buddhistcopy.Activity1">
<ScrollView
android:layout_width="300dp"
android:layout_height="300dp"
android:id="@+id/scrollView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:fillViewport="true"
android:isScrollContainer="true"
android:saveEnabled="true">
<TableLayout
android:id="@+id/sutra"
android:layout_width="295dp"
android:layout_height="295dp"
android:orientation="vertical"
>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:text="Test"
android:layout_width="10dp"
android:layout_height="10dp"
>
</EditText>
</TableRow>
</TableLayout>
</ScrollView>
</RelativeLayout>
是否尝试将以下属性添加到ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
尝试使用:
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TestText"
/>
您可能需要使用以下条件:wrap\u content
、fill\u parent
或match\u parent
,因为使用这些条件可以使您的视图元素根据设备屏幕进行相应的调整,设备屏幕可能会有所不同
此外,您可能还需要在编辑文本中添加一个
android:id=“@id/myIdentifier”
,以便将其链接到应用程序中正在进行的任何进程 未显示的内容,编辑文本?您可以共享xml吗?希望它不是你想要看到的滚动视图。。