滚动布局内的滚动视图?
我需要你的帮助。基本上我创建了一个scrollView作为activity的父布局。现在我需要在活动中添加许多小部件,包括一个编辑文本,其中包含在此编辑文本中设置的大文本值,该编辑文本也是可滚动的,但编辑文本中的文本滚动不顺畅?我需要像小部件这样的文本区域,我的 xml 代码如下所示
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#498BF4">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Registration"
android:gravity="center_horizontal"
android:textSize="20dip"/>
</LinearLayout>
<ScrollView
android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="User_id:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/user">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="FirstName:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/fname">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="LastName:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/lname">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Email:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/email">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Currency:*"
android:textSize="15dip"/>
<Spinner
android:id="@+id/spinner1"
android:layout_width="fill_parent"
android:layout_height="40dip">
</Spinner>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Date of Birth:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/dob">
</EditText>
<LinearLayout
android:id="@+id/agepermission"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:visibility="gone">
<EditText
android:layout_width="fill_parent"
android:layout_height="150dip"
android:id="@+id/ageterms"
android:maxLines="10"
android:textSize="10dip"
android:text="@string/hello"
>
</EditText>
<CheckBox
android:text="I have permission to use the website from parent/guardian.*"
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</CheckBox>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Parent Name:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/pname">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Parent Email:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/pemail">
</EditText>
</LinearLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Terms and conditions:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="200dip"
android:id="@+id/terms"
![android:text="i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets"][2]
android:inputType="textMultiLine"
android:textSize="10dip"
>
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="By clicking on 'Sign Up' button below you are agreeing to the Terms of Service above and both the Program Policy and the Privacy Policy."
android:textSize="15dip"/>
<Button
android:text="Sign Up"
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="40dip"
>
</Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets , my xml code shown below
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#498BF4">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Registration"
android:gravity="center_horizontal"
android:textSize="20dip"/>
</LinearLayout>
<ScrollView
android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="User_id:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/user">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="FirstName:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/fname">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="LastName:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/lname">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Email:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/email">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Currency:*"
android:textSize="15dip"/>
<Spinner
android:id="@+id/spinner1"
android:layout_width="fill_parent"
android:layout_height="40dip">
</Spinner>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Date of Birth:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/dob">
</EditText>
<LinearLayout
android:id="@+id/agepermission"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:visibility="gone">
<EditText
android:layout_width="fill_parent"
android:layout_height="150dip"
android:id="@+id/ageterms"
android:maxLines="10"
android:textSize="10dip"
android:text="@string/hello"
>
</EditText>
<CheckBox
android:text="I have permission to use the website from parent/guardian.*"
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</CheckBox>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Parent Name:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/pname">
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Parent Email:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="40dip"
android:id="@+id/pemail">
</EditText>
</LinearLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Terms and conditions:*"
android:textSize="15dip"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="200dip"
android:id="@+id/terms"
![android:text="i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets i need your help. Basically I created a scrollView as a parent layout of an activity . Now i need to add many widgets inside the activity including an edittext containing large text values set inside this edittext which is also scrollable , but my text inside an edit text not scrolling smoothly? i need text area like widgets"][2]
android:inputType="textMultiLine"
android:textSize="10dip"
>
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="By clicking on 'Sign Up' button below you are agreeing to the Terms of Service above and both the Program Policy and the Privacy Policy."
android:textSize="15dip"/>
<Button
android:text="Sign Up"
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="40dip"
>
</Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果输入是多行,请在 edittext 中使用以下标记
use below tag in your edittext , if it input is multiline
我这里也有同样的问题。
到目前为止,我知道唯一的解决方案是当 EditText 获得焦点时禁用 ScrollView 的滚动。
I am having the same problem here.
So far I know the only solution is to disable the scrolling of the ScrollView when the EditText got focus.