android – 在RelativeLayout中的ScrollView

android – 在RelativeLayout中的ScrollView,第1张

概述我需要在相对布局中做一个滚动视图. 当我添加ScrollView时,这是结果http://postimg.org/image/6abxth299/,其中组件仅占用屏幕的一半,当打开此屏幕时,键盘默认出现 <?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/a 我需要在相对布局中做一个滚动视图.

当我添加ScrollVIEw时,这是结果http://postimg.org/image/6abxth299/,其中组件仅占用屏幕的一半,当打开此屏幕时,键盘默认出现

<?xml version="1.0" enCoding="utf-8"?><ScrollVIEw    xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"    androID:scrollbars="vertical" >    <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:paddingBottom="@dimen/activity_vertical_margin"        androID:paddingleft="@dimen/activity_horizontal_margin"        androID:paddingRight="@dimen/activity_horizontal_margin"        androID:paddingtop="@dimen/activity_vertical_margin"        tools:context=".MainActivity"        androID:layout_centerHorizontal="true"        androID:ID="@+ID/data_entry_layout">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Post Title"                androID:ID="@+ID/post_Title"                androID:layout_alignBaseline="@+ID/post_Title_input"                androID:layout_alignBottom="@+ID/post_Title_input"                androID:layout_alignParentleft="true"                androID:layout_alignParentStart="true"                androID:textSize="26px"/>            <EditText                androID:layout_wIDth="fill_parent"                androID:layout_height="wrap_content"                androID:ID="@+ID/post_Title_input"                androID:layout_alignParentRight="true"                androID:layout_alignParentEnd="true"                androID:layout_toRightOf="@+ID/post_Title"                androID:layout_toEndOf="@+ID/post_Title"                androID:inputType="textCapSentences"/>            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Post Description"                androID:ID="@+ID/post_description"                androID:layout_below="@+ID/post_Title_input"                androID:layout_alignParentleft="true"                androID:layout_alignParentStart="true"                androID:layout_margintop="39dp"                androID:textSize="26px"/>            <EditText                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:inputType="textMultiline|textCapSentences"                androID:ems="10"                androID:ID="@+ID/editText"                androID:layout_margintop="16dp"                androID:layout_below="@+ID/post_description"                androID:layout_alignParentleft="true"                androID:layout_alignParentStart="true"/>            <Imagebutton                androID:layout_wIDth="match_parent"                androID:layout_height="match_parent"                androID:ID="@+ID/imagebutton1"                androID:layout_below="@+ID/editText"                androID:layout_alignParentleft="true"                androID:layout_alignParentStart="true"                androID:baselineAlignBottom="false"                androID:contextClickable="true"                androID:src="@drawable/image_button_icon"                androID:onClick="galleryIntent"/>            <button                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Cancel"                androID:ID="@+ID/cancel"                androID:layout_alignParentBottom="true"                androID:layout_alignParentleft="true"                androID:layout_alignParentStart="true"                androID:layout_below="@ID/imagebutton1"               />            <button                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="submit"                androID:ID="@+ID/submit"                androID:layout_aligntop="@+ID/cancel"                androID:layout_alignParentRight="true"                androID:layout_alignParentEnd="true"                androID:layout_below="@ID/imagebutton1"/>    </relativeLayout></ScrollVIEw>
解决方法 请尝试在此活动中将以下内容添加到AndroIDManifest,以便在默认情况下删除键盘

androID:windowsoftinputMode="statealwaysHIDden|adjustResize"

并使用androID:layout_height =“wrap_content”进行scrollvIEw,sugesting使用linearLayout和垂直方向布局进行此类使用.

总结

以上是内存溢出为你收集整理的android – 在RelativeLayout中的ScrollView全部内容,希望文章能够帮你解决android – 在RelativeLayout中的ScrollView所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1125769.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存