pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

在 ScrollView 和 ViewFlipper 中啟用 Scrollable EditText

Enable Scrollable EditText within a ScrollView and ViewFlipper(在 ScrollView 和 ViewFlipper 中啟用 Scrollable EditText)
本文介紹了在 ScrollView 和 ViewFlipper 中啟用 Scrollable EditText的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我在 ViewFlipper 中有兩個布局,每個布局中都包含 ScrollView.但是,我的 EditText 不起作用,我知道原因是由于 ScrollView.但是,盡管我嘗試了 Disable ScrollView action 中的答案,但沒有一個對我有用.我的xml在哪里有問題嗎?我的xml如下所示:

I have a two layout in a ViewFlipper which contains ScrollView in each of the layout. However, my EditText does not work and I know the reason is due to the ScrollView. However, though I tried the answers in Disable ScrollView action , none worked for me. Is there a problem with my xml some where? My xml is such shown below:

PageFlipper

PageFlipper

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
android:background="#FFF"
android:id="@+id/flipperlayout"
android:orientation="vertical">

<!-- Header -->

<include
    android:id="@+id/include1"
    layout="@layout/prepostheader" />

    <RelativeLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:background="#FFF"
    android:orientation="vertical">

<Button
    android:id="@+id/btnPage2"
    style="@style/PageBtnFont"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/include1"
    android:layout_marginTop="2dp"
    android:layout_marginRight="5dp"
    android:background="@drawable/button"
    android:text="Page 2" />

<Button
    android:id="@+id/btnPage1"
    style="@style/PageBtnFont"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/btnPage2"
    android:layout_alignBottom="@+id/btnPage2"
    android:layout_toLeftOf="@+id/btnPage2"
    android:layout_marginRight="5dp"
    android:background="@drawable/button"
    android:text="Page 1" />
</RelativeLayout>


<ViewFlipper
    android:id="@+id/flipper" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">        


    <include layout="@layout/prepostform" 
        android:adjustViewBounds="true"/>
    <include layout="@layout/prepostform2" 
        android:adjustViewBounds="true"/>

</ViewFlipper>

第1頁

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/editFormLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFF"
android:orientation="vertical" >

<ScrollView
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/scrollView"
    android:layout_weight="1"
    android:padding="5px">

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:adjustViewBounds="true"
    android:src="@drawable/formprepost" />



<EditText
    android:id="@+id/name"
    android:layout_width="400dp"
    android:layout_height="35dp"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/include1"
    android:layout_marginRight="90dp"
    android:layout_marginTop="134dp"
    android:background="#0000"
    android:ellipsize="start"
    android:inputType="textCapWords|textPersonName"
    android:lines="1"
    android:maxLines="1"
    android:textAppearance="@style/TextStyle1" >

</EditText>

<EditText
    android:id="@+id/school"
    android:layout_width="400dp"
    android:layout_height="35dp"
    android:layout_marginTop="-8dp"
    android:layout_alignLeft="@+id/name"
    android:inputType="textCapWords|textPersonName"
    android:background="#0000"
    android:textAppearance="@style/TextStyle1"
    android:ellipsize="start"
    android:maxLines = "1"
    android:lines = "1"
    android:layout_below="@+id/name" />

<EditText
    android:id="@+id/supervisor"
    android:layout_width="400dp"
    android:layout_height="35dp"
    android:layout_marginTop="-9dp"
    android:layout_alignLeft="@+id/school"
    android:inputType="textCapWords|textPersonName"
    android:background="#0000"
    android:textAppearance="@style/TextStyle1"
    android:ellipsize="start"
    android:maxLines = "1"
    android:lines = "1"
    android:layout_below="@+id/school" />

<EditText
    android:id="@+id/date"
    android:layout_width="200dp"
    android:layout_height="35dp"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/supervisor"
    android:layout_marginLeft="185dp"
    android:inputType="textCapWords|textPersonName"
    android:textAppearance="@style/TextStyle1"
    android:background="#0000"
    android:ellipsize="start"
    android:maxLines="1"
    android:layout_marginTop="116dp">
</EditText>

<CheckBox
    android:id="@+id/tick1"
    android:layout_width="540dp"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:button="@drawable/checkbox_selector"
    android:layout_below="@+id/date"
    android:layout_marginLeft="154dp"
    android:layout_marginTop="43dp"/>

<CheckBox
    android:id="@+id/tick2"
    android:layout_width="240dp"
    android:layout_height="wrap_content"
    android:layout_marginTop="-11dp"
    android:layout_alignLeft="@+id/tick1"
    android:button="@drawable/checkbox_selector"
    android:layout_below="@+id/tick1"/>

<CheckBox
    android:id="@+id/tick3"
    android:layout_width="270dp"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/tick2"
    android:layout_marginTop="-12dp"
    android:button="@drawable/checkbox_selector"
    android:layout_below="@+id/tick2" />




<EditText
    android:id="@+id/comment1"
    android:layout_width="614dp"
    android:layout_height="180dp"
    android:layout_alignParentLeft="true"
    android:layout_alignRight="@+id/tick1"
    android:layout_below="@+id/tick3"
    android:layout_marginLeft="94dp"
    android:layout_marginTop="23dp"
    android:gravity="top|left"
    android:inputType="textCapSentences|textMultiLine"
    android:textAppearance="@style/TextStyle1" >

</EditText>

<EditText
    android:id="@+id/comment2"
    android:layout_width="614dp"
    android:layout_height="165dp"
    android:layout_alignLeft="@+id/comment1"
    android:layout_alignRight="@+id/comment1"
    android:layout_below="@+id/comment1"
    android:layout_marginTop="90dp"
    android:gravity="top|left"
    android:inputType="textCapSentences|textMultiLine" />

<ImageButton
    android:id="@+id/signature1"
    android:layout_width="170dp"
    android:layout_height="50dp"
    android:layout_alignLeft="@+id/date"
    android:layout_below="@+id/comment1"
    android:layout_marginLeft="49dp"
    android:background="#0000"/>

<ImageButton
    android:id="@+id/signature2"
    android:layout_width="170dp"
    android:layout_height="50dp"
    android:layout_alignLeft="@+id/supervisor"
    android:layout_below="@+id/comment2"
    android:background="#0000" />

推薦答案

主要活動類:

您可以通過以下方式執(zhí)行此操作,還可以查看此鏈接

You can Perform this below way and also see this link

 EditText EtOne = (EditText) findViewById(R.id.comment1);
    EtOne.setOnTouchListener(new OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent event) {
                    if (v.getId() == R.id.comment1) {
                        v.getParent().requestDisallowInterceptTouchEvent(true);
                        switch (event.getAction() & MotionEvent.ACTION_MASK) {
                        case MotionEvent.ACTION_UP:
                            v.getParent().requestDisallowInterceptTouchEvent(false);
                            break;
                        }
                    }
                    return false;
                }
            });

這篇關于在 ScrollView 和 ViewFlipper 中啟用 Scrollable EditText的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關文檔推薦

Cut, copy, paste in android(在android中剪切、復制、粘貼)
android EditText blends into background(android EditText 融入背景)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數(shù)的數(shù)字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 土壤养分检测仪_肥料养分检测仪_土壤水分检测仪-山东莱恩德仪器 大型多片锯,圆木多片锯,方木多片锯,板材多片锯-祥富机械有限公司 | 聚氨酯保温钢管_聚氨酯直埋保温管道_聚氨酯发泡保温管厂家-沧州万荣防腐保温管道有限公司 | 济南品牌包装设计公司_济南VI标志设计公司_山东锐尚文化传播 | 地图标注-手机导航电子地图如何标注-房地产商场地图标记【DiTuBiaoZhu.net】 | 河南凯邦机械制造有限公司 | 水热合成反应釜-防爆高压消解罐-西安常仪仪器设备有限公司 | 生鲜配送系统-蔬菜食材配送管理系统-连锁餐饮订货配送软件-挪挪生鲜供应链管理软件 | 软膜天花_软膜灯箱_首选乐创品牌_一站式天花软膜材料供应商! | 实验室pH计|电导率仪|溶解氧测定仪|离子浓度计|多参数水质分析仪|pH电极-上海般特仪器有限公司 | 天津散热器_天津暖气片_天津安尼威尔散热器制造有限公司 | 奥因-光触媒除甲醛公司-除甲醛加盟公司十大品牌 | 不锈钢水箱生产厂家_消防水箱生产厂家-河南联固供水设备有限公司 | 礼堂椅厂家|佛山市艺典家具有限公司 | 井式炉-台车式回火炉-丹阳市电炉厂有限公司 | 翅片管换热器「型号全」_厂家-淄博鑫科环保 | PO膜_灌浆膜及地膜供应厂家 - 青州市鲁谊塑料厂| 济南玻璃安装_济南玻璃门_济南感应门_济南玻璃隔断_济南玻璃门维修_济南镜片安装_济南肯德基门_济南高隔间-济南凯轩鹏宇玻璃有限公司 | 安徽千住锡膏_安徽阿尔法锡膏锡条_安徽唯特偶锡膏_卡夫特胶水-芜湖荣亮电子科技有限公司 | 温州在线网| 东莞办公家具厂家直销-美鑫【免费3D效果图】全国办公桌/会议桌定制 | 浩方智通 - 防关联浏览器 - 跨境电商浏览器 - 云雀浏览器 | 刺绳_刀片刺网_刺丝滚笼_不锈钢刺绳生产厂家_安平县浩荣金属丝网制品有限公司-安平县浩荣金属丝网制品有限公司 | 盐城网络公司_盐城网站优化_盐城网站建设_盐城市启晨网络科技有限公司 | 昆明化妆培训-纹绣美甲-美容美牙培训-昆明博澜培训学校 | 电力电子产业网 | 涂层测厚仪_光泽度仪_uv能量计_紫外辐照计_太阳膜测试仪_透光率仪-林上科技 | 压砖机_电动螺旋压力机_粉末成型压力机_郑州华隆机械tel_0371-60121717 | 北京软件开发_软件开发公司_北京软件公司-北京宜天信达软件开发公司 | GAST/BRIWATEC/CINCINNATI/KARL-KLEIN/ZIEHL-ABEGG风机|亚喜科技 | 新材料分散-高速均质搅拌机-超声波分散混合-上海化烁智能设备有限公司 | 天津仓储物流-天津电商云仓-天津云仓一件代发-博程云仓官网 | 云南标线|昆明划线|道路标线|交通标线-就选云南云路施工公司-云南云路科技有限公司 | 低粘度纤维素|混凝土灌浆料|有机硅憎水粉|聚羧酸减水剂-南京斯泰宝 | 仿真茅草_人造茅草瓦价格_仿真茅草厂家_仿真茅草供应-深圳市科佰工贸有限公司 | 航空障碍灯_高中低光强航空障碍灯_民航许可认证航空警示灯厂家-东莞市天翔航天科技有限公司 | 高铝砖-高铝耐火球-高铝耐火砖生产厂家-价格【荣盛耐材】 | 恒温恒湿试验箱_高低温试验箱_恒温恒湿箱-东莞市高天试验设备有限公司 | 钢化玻璃膜|手机钢化膜|钢化膜厂家|手机保护膜-【东莞市大象电子科技有限公司】 | 防弹玻璃厂家_防爆炸玻璃_电磁屏蔽玻璃-四川大硅特玻科技有限公司 | 球磨机,节能球磨机价格,水泥球磨机厂家,粉煤灰球磨机-吉宏机械制造有限公司 | 一礼通 (www.yilitong.com)-企业礼品解决方案一站式服务平台 |