自定义EditText控制DrawableRight的显示或隐藏

Android动态设置drawableRight 安卓在代码中动态设置TextView的drawableLeft、drawableRight、drawableTop、drawableBottom,api为我们提供了一个setCompoundDrawables(left,top,right,bottom);方法,供开发人员设置相应的边界图片。在xml中设置的方法为:android:drawableLeft=“@drawable/xxxxx”;但是在代码中并没有相关的setDrawableLeft等方法。 阅读详情

目的:

有时候在做搜索功能时,如果EditText有内容,则在右侧显示一个删除图标,点击删除图标删除内容;

当EditText内容为空时,则隐藏删除图标。

效果图:

p.s. 这是我正在做的一个毕业设计,Android + JavaWeb。前端app,后台都会有。我每天会往Github上提交代码,这个上面会有完整的项目。欢迎star,fork。GitHub:https://github.com/uweii/SHShop

我们开始:

/*
* 自定义EditText,有文字时,右边显示删除按钮
* 没有文字时,隐藏删除按钮
* */
public class ClearTextEditText extends AppCompatEditText implements View.OnFocusChangeListener, TextWatcher {
    private Drawable mClearDrawable;
    private boolean hasFocus; //控件是否有焦点
    public ClearTextEditText(Context context) {
        super(context);
        init(context, null);
    }

    public ClearTextEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context, attrs);
    }

    public ClearTextEditText(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context, attrs);
    }
    private void init(Context context, AttributeSet attr){
        mClearDrawable = getCompoundDrawables()[2];
        if(mClearDrawable == null){
            mClearDrawable = getResources().getDrawable(R.drawable.del_icon);
        }
        //drawable.setBounds :设置Drawable的边界,必须要有
        mClearDrawable.setBounds(0,0, mClearDrawable.getIntrinsicWidth(), mClearDrawable.getIntrinsicHeight());
        setOnFocusChangeListener(this);
        addTextChangedListener(this);
    }

    @Override
    public void onFocusChange(View view, boolean b) {
        this.hasFocus = b;
        LogUtil.d("hasFocus: " + b);
        if (hasFocus){
            //焦点存在,而且有输入值,显示右侧删除图标
            setDrawableRightVisible(getText().length() > 0);
        }else {
            //没有焦点,隐藏删除图标
            setDrawableRightVisible(false);
            clearFocus();
        }
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if(event.getAction() == MotionEvent.ACTION_UP){
            if(getCompoundDrawables()[2] != null){
                //根据触摸的位置判断是否点击 右侧图标
                boolean isTouchRight = (event.getX() > (getWidth() - getTotalPaddingRight())) &&
                        (event.getX() < (getWidth() - getPaddingRight()));
                //LogUtil.d("isTouchRight: " + isTouchRight);
                if(isTouchRight){
                    setText("");
                }
            }
        }
        return super.onTouchEvent(event);
    }

    private void setDrawableRightVisible(boolean visible){
        Drawable drawableRight = visible ? mClearDrawable : null;
        //getCompoundDrawables()可以获得一个{DrawableLeft, DrawableTop, DrawableRiht, DrawableBottom}的数组。
        //getCompoundDrawables()[2]表示获取EditText的DrawableRight
        setCompoundDrawables(getCompoundDrawables()[0],getCompoundDrawables()[1], drawableRight, getCompoundDrawables()[3]);
    }

    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        if(mOnTextChangedListener != null){
            mOnTextChangedListener.beforeTextChanged(charSequence, i, i1, i2);
        }
    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        if(hasFocus){
            setDrawableRightVisible(charSequence.length() > 0);
        }
        if(mOnTextChangedListener != null){
            mOnTextChangedListener.onTextChanged(charSequence, i, i1, i2);
        }
    }

    @Override
    public void afterTextChanged(Editable editable) {
        if(mOnTextChangedListener != null){
            mOnTextChangedListener.afterTextChanged(editable);
        }
    }
    //文本改变接口监听
    public interface OnTextChangedListener{
        void beforeTextChanged(CharSequence s, int start, int count, int after);

        void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter);

        void afterTextChanged(Editable s);
    }
    private OnTextChangedListener mOnTextChangedListener;
    public void setOnTextChangedListener(OnTextChangedListener onTextChangedListener){
        this.mOnTextChangedListener = onTextChangedListener;
    }

}

现在我们就使用这个自定义控件:

 <com.up.uwei.shshop.view.ClearTextEditText
                android:id="@+id/et_search"
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="5dp"
                android:layout_weight="5"
                android:background="@drawable/bg_input"
                android:drawableLeft="@drawable/ic_search"
                android:gravity="center_vertical"
                android:hint="输入搜索"
                android:textColor="@color/search_hint"
                android:textSize="15sp" />

就可以咯、

Android中EditText的drawableRight属性设置点击事件 主要介绍了Android中EditText的drawableRight属性的图片设置点击事件,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 立即下载

相关推荐

5.FxBlue跟单常见问题

fxblue喊单ea和fxblue跟单会在mt4/mt5客户端ea栏目里记录fxblue在跟单复制订单过程中的全面记录。在遇到问题时,我们首先要恢复默认参数尝试,然后再到ea栏找报错提示。 ​ 需要注意的是,是EA选项卡,而不是日志选项卡。 此外,您可以在 MT4/5 软件终端面板的"EA"选项卡中查看跟单记录,您可以通过右键单击 Experts 日志并从 MT4/5 的弹出菜单中选择“打开”来打开每日日志文件以及历史文件。 5.1 No “heartbeat” received 没有收到“心跳” 接收方

weixin_44406393的博客 1892

android Edittext密码隐藏,EditText实现密码显示和隐藏

很多场景都有会用到EditText,用来接收用户输入的一些信息,当EditText是密码输入类型的时候,用户输入的信息都会被系统用原点給代替,保证其他人无法看见输入信息,但是有些时候我们自己也想看看自己输入的内容是否正确,那应该怎么样呢?EditText可以通过setTransformationMethod设置不同的值可以显示和隐藏文本内容。显示为明文setTransformationMethod...

weixin_35305499的博客 908

本体研究综述(转)

(这篇文章是从http://imarine.blog.163.com/中转载过来的,个人觉得对本体的介绍比较全面!)本体综述本体作为一种能在语义和知识层次上描述领域概念的建模工具,其目标是捕获相关领域的知识,确定该领域内共同认可的词汇,通过概念之间的关系来描述概念的语义,提供对该领域知识的共同理解。语义Web(the Semantic Web)是在本体理论基础之上对现有Web所进行的扩展[

zhenshideni611的专栏 1847

Android 代码中设置drawableleft 改变,隐藏。

Drawable drawable= getResources().getDrawable(R.drawable.drawable);  /// 这一步必须要做,否则不会显示.  drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());  myTextview.setCompoundDraw...

yijiaodingqiankun的博客 5937

法兰克仿真软件FANUC CNC Guide v25.0 安装教程及中文设置

下载地址在文末。我们公司用新到一批FANUC 系统的设备,为方便使用就装了一个 FANUC 数控系统仿真软件FANUC CNC Guide v25.0 ,还是最新版不是市面上流传的老版本。模拟学习一下。

hakesashou的博客 1万+

S7-1200 Modbus TCP客户端配置实战:从基础设置到数据交互详解

本文详细介绍了S7-1200 Modbus TCP客户端的配置方法,从基础设置到数据交互的完整流程。涵盖硬件准备、TIA Portal配置、MB_CLIENT指令参数详解、数据缓冲区管理及实战测试,帮助工程师快速掌握西门子PLC与Modbus TCP通信的关键技术。

fire9的博客 322

代码中隐藏DrawableRight 图片

The drawableLeft (or any of the similar attributes) XML attribute can be modified (removing a drawable in your case) via code using something like this: yourTextView.setCompoundDrawablesWithIntri

csdnandroid123的博客 1724

FlowPic实战:从流量到图像的端到端加密应用识别

本文深入解析了FlowPic技术如何将网络流量转化为图像,并利用CNN模型进行端到端加密应用识别。该方法通过分析数据包大小和时序信息生成流量图像,有效绕过加密内容,实现对视频、聊天、文件传输等应用的精准分类。文章提供了从流量抓取、图像生成到轻量级CNN模型设计与训练的完整实战指南,并探讨了在VPN、Tor等复杂场景下的应用与挑战。

weixin_29046035的博客 157

Android EditText响应drawableRight等的点击事件

前言我们在输入框EditText中,经常会添加比如删除X,下拉箭头等图标,以得到更好的用户体验和需求,如果放在右边,我们经常设置drawableRight属性来实现,那么这些图标如何响应点击事件呢?下面简单记录一下!方法首先我们要继承AppCompatEditText,实现一个自定义的EditText(现在一般为了兼容和实现MD风格,都会继承AppCompatEditText,而不再去继承EditT

苦逼的程序猿☺ 3325

uniapp [微信小程序] - 详解微信小程序端接入mqtt全流程及示例源码教程,uniApp微信小程序端如何接入MQTT插件并实现连接/断开+发布订阅+消息队列+离线重连等各种示例代码(开箱即用)

uniapp微信小程序接入MQTT,uniapp中使用mqtt,uniapp 微信小程序端接入mqtt示例代码教程,适用于微信小程序的MQTT插件,uniapp开发微信小程序连接mqtt,uniApp微信小程序接入MQTT协议,uniapp vue3微信小程序使用MQTT的小例子接入流程,使用uniapp开发小程序接入mqtt,如何在uniapp项目中使用mqtt,uniapp mqtt的使用示例,mqtt连接报错,如何在项目里集成mqtt,Mqtt协议,主动连接mqtt,订阅消息,实现发布,订阅和接收消息

🏆 前端领域优质创作者 2893

SpringBoot项目搭建

SpringBoot项目搭建

私信可回答各种问题~ 1055

Android 自定义自动清空EditText

Android系统自带的EditText,虽然功能是实现了,但是总是感觉给人是缺胳膊少腿的。你就不能像ios一样,输入框的末尾加个小叉叉吗?通常Android要实现这个功能,很常见的是使用组合布局实现,但是这样不好!原因可见这篇文章Android 性能优化之布局优化。还有就是利用EditEdit的右边添加rightDrawable的属性实现,但是通常又要UI妹妹切一张图甚是麻烦!于是,我觉得直接用Java代码画出一个叉叉,实现一键清空的EdidText ,高仿京东首页搜索框!

玄影的博客 2130

RK3588平台开发系列讲解(项目篇)常见模型结构

📢 AI 模型常采用人工神经网络来模拟人脑神经的记忆和处理信号的能力。常见的人工神经网络类型有深度神经网络(Deep Neural Network,DNN)、卷积神经网络(Convolutional Neural Network,CNN)、循环神经网络(Recurrent Neural Network,RNN)等。

内核笔记 1765

EditText相关内容

EditText继承关系:View-->TextView-->EditText   EditText的属性很多,这里介绍几个: android:hint="请输入数字!"//设置显示在空间上的提示信息 android:numeric="integer"//设置只能输入整数,如果是小数则是:decimal android:singleLine="true"//设置单行输入,一旦设置为true

lilt085163的专栏 816

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

EditText属性

EditText继承关系:View-->TextView-->EditText   EditText的属性很多,这里介绍几个: android:hint="请输入数字!"//设置显示在空间上的提示信息 android:numeric="integer"//设置只能输入整数,如果是小数则是:decimal android:singleLine="true"//设置单行输入,一旦设置为true

u010568407的专栏 423

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

android ui 参数传递,android ui界面设计参数讲解

ANDROIDUI界面设计参数讲解ANDROIDLAYOUT_WIDTH设置组件的宽度ANDROIDLAYOUT_HEIGHT设置组件的高度ANDROIDID给组件定义一个ID值,供后期使用ANDROIDBACKGROUND设置组件的背景颜色或背景图片ANDROIDTEXT设置组件的显示文字ANDROIDTEXTCOLOR设置组件的显示文字的颜色ANDROIDLAYOUT_BELOW组件在参考组件...

weixin_30825953的博客 368

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

android TextView EditView 属性收集

EditText继承关系:View-->TextView-->EditText   EditText的属性很多,这里介绍几个: android:hint="请输入数字!"//设置显示在空间上的提示信息 android:numeric="integer"//设置只能输入整数,如果是小数则是:decimal android:singleLine="true"//设置单行输入,一旦设

jiangjie4558的专栏 591

DrawRightEditText自定义EditText实现有内容时右侧图标按钮显示无内容时右侧图标按钮隐藏加上为空时晃动动画(二)...

经过大神指导,上面封装的还不够全面,触摸事件应该也放进自定义中去,那么问题来了,怎么区分呢!,这就涉及到了自定义属性的介绍了 我通过设置属性来判断在onTouch事件中应该进行什么操作,接下来看看改良的代码 首先在attrs中设置样式 1 <declare-styleable name="drawrighteditview"> 2 <attr name="edit_typ...

weixin_30469895的博客 166

EditText——右边图片drawableRight的点击事件

EditText右边图片的点击事件,如输入账号或密码之后可以直接清空,方便好用的控件!

greyson的博客 5422

Android 设置 drawableLeft|Right|Top|Bottom

由于遇到需求, 需要动态设置 TextView drawableLeft 的图片, 因此在这做一些笔记。

nukix 1766

EditText(8)EditText中drawableRight图片的点击事件

参考:     http://stackoverflow.com/questions/3554377/handling-click-events-on-a-drawable-within-an-edittext 本例以drawableRight 为例,其它类似。    思路:   重写EditText的OnTouchListener事件,在up事件中判断手指的位置,如果...

banyinlve3147的博客 267

自定义EditText 实现drawableRight/drawableLeft 点击事件

我们在开发APP布局时候经常会看到在EditText的右侧或者左侧出现类似如下的ICON 以前常用的做法是在最外层使用RelativeLayout包裹内部的ImagView与EditText: <RelativeLayout android:id="@+id/relativeLayout" android:layout_width="ma

zcmain的专栏 2264

自定义EditText实现DrawableRight的点击事件

王濬楼船下益州,金陵王气黯然收。 千寻铁锁沉江底,一片降幡出石头。 人世几回伤往事,山形依旧枕寒流。 今逢四海为家日,故垒萧萧芦荻秋。唐·刘禹锡《西塞山怀古》

henkun的博客 847

drawableRight中图标的点击事件

android 解决drawableRight属性的图标点击事件

u014128885的专栏 5710

Android中控制点击EditText输入框右边清空图标的显示与隐藏.

1.本文代码主要出自:http://blog.csdn.net/daitu_liang/article/details/48730889.   即其中第二种方法 2.重写EditText public class ClearEditText extends EditText implements View.OnFocusChangeListener, TextWatcher

圣西罗的红与黑 1468
上一篇: 动态设置状态栏背景颜色和状态栏字体颜色
下一篇: Activity全屏
uweii
博客等级 码龄10年 9402粉丝 99原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值