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問題)
主站蜘蛛池模板: 呼末二氧化碳|ETCO2模块采样管_气体干燥管_气体过滤器-湖南纳雄医疗器械有限公司 | 包装机传感器-搅拌站传感器-山东称重传感器厂家-济南泰钦电气 | 全自动端子机|刺破式端子压接机|全自动双头沾锡机|全自动插胶壳端子机-东莞市傅氏兄弟机械设备有限公司 | 山西3A认证|太原AAA信用认证|投标AAA信用证书-山西AAA企业信用评级网 | 亚克隆,RNAi干扰检测,miRNA定量检测-上海基屹生物科技有限公司 | 流变仪-热分析联用仪-热膨胀仪厂家-耐驰科学仪器商贸 | 匀胶机旋涂仪-声扫显微镜-工业水浸超声-安赛斯(北京)科技有限公司 | 数码管_LED贴片灯_LED数码管厂家-无锡市冠卓电子科技有限公司 | 重庆波纹管|重庆钢带管|重庆塑钢管|重庆联进管道有限公司 | 传动滚筒_厂家-淄博海恒机械制造厂 | 全自动过滤器_反冲洗过滤器_自清洗过滤器_量子除垢环_量子环除垢_量子除垢 - 安士睿(北京)过滤设备有限公司 | 宽带办理,电信宽带,移动宽带,联通宽带,电信宽带办理,移动宽带办理,联通宽带办理 | 半容积式换热器_北京浮动盘管换热器厂家|北京亿丰上达 | 上海网站建设-上海网站制作-上海网站设计-上海做网站公司-咏熠软件 | 苏州教学设备-化工教学设备-环境工程教学模型|同科教仪 | 济南画室培训-美术高考培训-山东艺霖艺术培训画室 | 车件|铜件|车削件|车床加工|五金冲压件-PIN针,精密车件定制专业厂商【东莞品晔】 | 集菌仪_智能集菌仪_全封闭集菌仪_无菌检查集菌仪厂家-那艾 | 披萨石_披萨盘_电器家电隔热绵加工定制_佛山市南海区西樵南方综合保温材料厂 | 精密模具-双色注塑模具加工-深圳铭洋宇通 | 上海宿田自动化设备有限公司-双面/平面/单面贴标机 | 小威小说网 - 新小威小说网 - 小威小说网小说搜索引擎 | 北京四合院出租,北京四合院出售,北京平房买卖 - 顺益兴四合院 | 头条搜索极速版下载安装免费新版,头条搜索极速版邀请码怎么填写? - 欧远全 | 玻纤土工格栅_钢塑格栅_PP焊接_单双向塑料土工格栅_复合防裂布厂家_山东大庚工程材料科技有限公司 | 【星耀裂变】_企微SCRM_任务宝_视频号分销裂变_企业微信裂变增长_私域流量_裂变营销 | YT保温材料_YT无机保温砂浆_外墙保温材料_南阳银通节能建材高新技术开发有限公司 | 远程会诊系统-手术示教系统【林之硕】医院远程医疗平台 | 鄂泉泵业官网|(杭州、上海、全国畅销)大流量防汛排涝泵-LW立式排污泵 | 防勒索软件_数据防泄密_Trellix(原McAfee)核心代理商_Trellix(原Fireeye)售后-广州文智信息科技有限公司 | 快速门厂家批发_PVC快速卷帘门_高速门_高速卷帘门-广州万盛门业 快干水泥|桥梁伸缩缝止水胶|伸缩缝装置生产厂家-广东广航交通科技有限公司 | 企典软件一站式企业管理平台,可私有、本地化部署!在线CRM客户关系管理系统|移动办公OA管理系统|HR人事管理系统|人力 | 实木家具_实木家具定制_全屋定制_美式家具_圣蒂斯堡官网 | elisa试剂盒价格-酶联免疫试剂盒-猪elisa试剂盒-上海恒远生物科技有限公司 | 鲁尔圆锥接头多功能测试仪-留置针测试仪-上海威夏环保科技有限公司 | 青岛侦探_青岛侦探事务所_青岛劝退小三_青岛调查出轨取证公司_青岛婚外情取证-青岛探真调查事务所 | 热处理温控箱,热处理控制箱厂家-吴江市兴达电热设备厂 | CXB船用变压器-JCZ系列制动器-HH101船用铜质开关-上海永上船舶电器厂 | LNG鹤管_内浮盘价格,上装鹤管,装车撬厂家-连云港赛威特机械 | 一体式钢筋扫描仪-楼板测厚仪-裂缝检测仪-泰仕特(北京) | 全自动烧卖机厂家_饺子机_烧麦机价格_小笼汤包机_宁波江北阜欣食品机械有限公司 |