EditText 背景设置

ADS Layout设计实战:从参数设置到协同仿真 本文详细介绍了ADS Layout设计的完整实战流程,从新建工程、单位设置、个性化偏好配置等基础操作入手,逐步深入到基板参数配置、端口设置与电磁仿真器选择等核心环节。重点阐述了参数化版图设计与扫描优化、以及原理图与Layout协同仿真的高级技巧,并通过一个微带线低通滤波器设计案例,完整演示了从理论到实现的闭环设计方法,帮助工程师高效、准确地完成高频电路版图设计与验证。 阅读详情

EditText 背景设置

1. 调整背景颜色

EditText默认的效果:

默认背景颜色

其中,下划线的颜色有两种状态:

  1. normal color 没有焦点时的颜色,可以通过colorControlNormal来设置。
  2. activated color 获取到焦点时的颜色,可以通过colorControlActivated来设置。

eg.

styles.xml

    <!-- EditText 样式 -->
    <style name="EditTextStyle" parent="Base.Widget.AppCompat.EditText">

        <item name="colorControlNormal">@color/edit_text_normal_color</item>
        <item name="colorControlActivated">@color/edit_text_activated_color</item>
    </style>

colors.xml

    <!-- EditText -->
    <color name="edit_text_normal_color">#00FF00</color>
    <color name="edit_text_activated_color">#FF00FF</color>

在布局文件中,设置EditText的theme:

    <EditText
        android:id="@+id/et_user_name"
        android:layout_width="300dp"
        android:layout_height="80dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="50dp"
        android:hint="请输入用户名"
        android:textSize="20sp"
        android:theme="@style/EditTextStyle" />

这样设置之后,效果图为:

自定义背景颜色

2. 设置背景下划线的位置

默认情况下,EditText的style设置为Base.Widget.AppCompat.EditText,查看其源代码,我们可以一步一步地看到其具体的设值:(具体代码位置为sdk_path/platforms/android-xx/data/res)


    <!-- styles.xml -->
    <style name="Base.Widget.AppCompat.EditText" parent="Base.V7.Widget.AppCompat.EditText"/>

    <!-- styles.xml -->
    <style name="Base.V7.Widget.AppCompat.EditText" parent="android:Widget.EditText">
        <item name="android:background">?attr/editTextBackground</item>
        <item name="android:textColor">?attr/editTextColor</item>
        <item name="android:textAppearance">?android:attr/textAppearanceMediumInverse</item>
    </style>

    <!-- themes_material.xml -->
    <item name="editTextBackground">@drawable/edit_text_material</item>

其中,edit_text_material的内容为:

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<inset xmlns:android="http://schemas.android.com/apk/res/android"
       android:insetLeft="@dimen/edit_text_inset_horizontal_material"
       android:insetRight="@dimen/edit_text_inset_horizontal_material"
       android:insetTop="@dimen/edit_text_inset_top_material"
       android:insetBottom="@dimen/edit_text_inset_bottom_material">
    <selector>
        <item android:state_enabled="false">
            <nine-patch android:src="@drawable/textfield_default_mtrl_alpha"
                android:tint="?attr/colorControlNormal" />
        </item>
        <item android:state_pressed="false" android:state_focused="false">
            <nine-patch android:src="@drawable/textfield_default_mtrl_alpha"
                android:tint="?attr/colorControlNormal" />
        </item>
        <item>
            <nine-patch android:src="@drawable/textfield_activated_mtrl_alpha"
                android:tint="?attr/colorControlActivated" />
        </item>
    </selector>
</inset>

可以看到,EditText默认的background是一个InsetDrawable。

关于InsetDrawable的相关知识:

InsetDrawable对应于<inset>标签,它可以将其他Drawable内嵌到自己当中去,并可以在四周留出一定的间距。当一个View希望自己的背景比自己的实际区域小的时候,可以使用InsetDrawable来实现。其中,InsetDrawable的语法为:

<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
       android:drawable="@drawable/drawable_resource"
       android:insetLeft="dimension"
       android:insetRight="dimension"
       android:insetTop="dimension"
       android:insetBottom="dimension">
</inset>

android:insetLeft等四个属性分别表示,左右上下内凹的大小。

android:drawable表示资源图片的位置。该资源距离外边距的大小即insetLeft等的值。

另外,inset内部还可以包含shape,color, nine-patch等元素。这些边距表示距离inset内部的元素的距离。在EditText的backgound中,安卓系统就使用了selector+nine-patch。

EditText的背景默认边距

我们可以查看源代码:

    <!-- values/dimens_material.xml -->
    <dimen name="edit_text_inset_horizontal_material">4dp</dimen>
    <dimen name="edit_text_inset_top_material">10dp</dimen>
    <dimen name="edit_text_inset_bottom_material">7dp</dimen>

所以,我们看到的默认EditText背景框,其距离左右距离各4dp,距离上部10dp,距离底部7dp。

修改背景边距

在做项目的时候,我们有一个需求,就是EdtiText的背景下划线,是紧贴这EditText的底部的,并且左右也是紧贴着的。所以,我们可以将相关的源代码拿过来,然后修改边距的数值即可:

具体步骤为:

  1. 复制相关源代码到资源目录:edit_text_material.xml, textfield_activated_mtrl_alpha.9.png , textfield_default_mtrl_alpha.9.png
  2. 在dimens.xml文件中添加尺寸,并根据需求设值。
  3. 在布局文件中设值EditText的background。

在demo中,我将第一个EditText的背景边距设置为0,而第二个EditText为默认边距,大家可以对比看一下效果:

设值背景边距

Demo 地址

TSMC40nmLP版图实战:从Design Rule解读到Cadence高效布局布线 本文详细解析了TSMC40nmLP工艺的版图设计实战,从Design Rule解读到Cadence高效布局布线技巧。重点介绍了40nm工艺中的关键设计规则,如最小线宽、间距规则和深N阱规则,并分享了Cadence Virtuoso中的高效工作流和射频模块设计技巧,帮助工程师提升版图设计效率和质量。 阅读详情

相关推荐

MongoDB启动失败(service mongod start):Failed to unlink socket file /tmp/mongodb-27017.sock Unknown error

错误日志(/var/log/mongodb/mongo.log): 2019-09-16T06:00:00.251+0000 I CONTROL [main] ***** SERVER RESTARTED ***** 2019-09-16T06:00:00.253+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-e...

deantzzz的博客 1838

Android 修改EditText的光标颜色和背景色

一、EditText的光标颜色 在xml布局文件中  Android:textCursorDrawable=”@null” 表示光标的颜色和字体的颜色一样 当然,我们也可以自定义光标的颜色,在drawable文件夹下写个edit_cursor_color.xml文件 xml version="1.0" encoding="utf-8"?> xmlns:android="ht

敢于挑战我可以的博客 2764

kubernetes rook 安装 cephfs

ceph root kubernete osd uuid partuuid

天津托的博客 1543

修改EditText背景和光标

背景 安卓原生的EditText样式不太好看(光标和背景),不同的项目都需要定制。 解决方案 最优方案 设置主题中colorAccent的颜色,即可改变EditText光标和背景颜色。 如果不能改变application主题颜色,也可以单独针对指定的activity设定主题。 样例: 1). Manifest文件中application配置主题 &lt;application ...

蓝不蓝编程 711

使用 ANSYS AEDT(双向耦合)对高功率射频同轴滤波器进行热分析

使用 ANSYS HFSS,可以精确计算 EM 损耗,然后将其导入 ANSYS 热分析并使用 ANSYS Icepak CFD 求解器进行仿真,以帮助工程师解决最复杂的热挑战,并预测其设计在温度变化下的表现。然后,RF 损耗将与 ANSYS Icepak CFD 求解器耦合,以执行热分析,包括传热的传导、对流和辐射模式,并计算温度曲线。在此演示中,我们将仿真下面的 RF 同轴滤波器,并计算由于所用材料的有限电导率和介电损耗而导致的 RF 传导损耗。设置 HFSS 设计后,我们可以开始 HFSS 仿真。

jkh920184196的博客 1051

CGAL AlphaShape算法(自适应Alpha值,二维版本)

CGAL AlphaShape算法(自适应Alpha值,二维版本)

dayuhaitang1的博客 2325

EditText的背景颜色的设置及android.graphics.Color的使用

1.设置EditText的背景颜色   private test_editText=null; test_editText= (EditText) findViewById(R.id.EditTextInput); test_editText.setBackgroundColor(R.drawable.Black); //设置为黑色背景 test_editTex

单向街的夏天 7198

基于STM32L4XX 、HAL库的ATD5984步进电机驱动器驱动程序应用设计

一、简介: ATD5984是一款内部集成了译码器的微特步进电机 驱动器,能使双极步进电机以全、半、1/4、/1/8、1/16 和1/32步进模式工作。步进模式由逻辑输入管脚MSx选 择。其输出驱动能力达到28V±1.6A。 译码器是ATD5984易于使用的关键,通过STEP管脚 输入一个脉冲就可以使电机完成一次步进,省去了相序 表,高频控制线及复杂的编程接口,使其更适于没有复 杂的微处理器或微处理器负担过重的场合。 在步进操作期间,ATD5984的内部电路可以自动

PP_Cottage的博客 408

[原创]刨根问底掌握布局样式主题追踪edittext背景默认样式修改下划线分析距离左边有一点距离的原因...

首先从EditText源码中发现R.attr.editTextStyle 首先要说明的是style分别是materialdesign库和来系统架构目录两种,都可以定位。 public EditText(Context context, AttributeSet attrs) { this(context, attrs, com.android.internal.R.attr.edi...

情随事迁个人博客 408

Ceph入门到精通-存储桶通知

这 通知还可以根据前缀的匹配项过滤掉事件,并且 (1) 键的后缀,(2) 附加到对象的元数据属性, 或 (3) 对象标签。在此模式下,操作仅在以下之后确认(确认) 通知将发送到主题的已配置终端节点。这意味着 通知的往返时间(发送 通知主题的终端节点以及接收 确认)被添加到操作本身的延迟中。要更新主题,请使用用于创建主题的相同命令(但在 更新时,使用现有主题的名称和不同的终端节点值)。端口:对于未加密的连接,默认为 5672,对于未加密的连接,默认为 5671 SSL 加密连接。(默认情况下,这是“假的”。

隔壁老瓦的专栏 1131

作为一名爬虫人如何实现千万级数据爬取?

爬虫门槛不高,高就高在往后余生的每一次实操都随时会让你崩溃!Bro

吴秋霖的博客 1万+

android edittext 背景色,Button根据EditText输入状态改变背景颜色

需求Button随EditText输入状态改变颜色有3个不同颜色状态,EditText未输入时,Button处于不可点击状态EditText输入时,Button处于高亮状态EditText输入且用户按下按钮,Button --> Pressed状态效果如下:演示图片EditText在没有输入时,Button不可点击,为灰色状态EditText输入后,Button可点击,且背景变为蓝色Edit...

weixin_29190573的博客 1091

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

android edittext背景颜色,Android 设置 EditText 背景颜色、背景图片

Android 设置 EditText 背景颜色mView.findViewById(R.id.editText).setBackgroundResource(R.color.caution);Android 设置 EditText 背景图片(程序设置)其实这个不是背景,因为如果图片太大,它会挤大 EditText,并且它占用的地方也不能输入文字。float size = ((EditText)m...

weixin_32460203的博客 2203

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

将Android Studio里的EditText控件弄成圆角(即背景设置为弧形)

1.先写一个EditText圆角的样式xml,路径res/drawable/translucent.xml(drawable→new→Drawable resource file) 在translucent中写入下面代码 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schema...

dreamer2333的博客 1万+

深度学习工具包 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")

android edittext边框背景,Android:设置EditText 背景

1.android:background 属性指定控件背景android:id="@+id/editText"android:layout_width="wrap_content"android:layout_height="wrap_content"android:inputType="text"android:background="@drawable/editor_selector" /&g...

weixin_33677704的博客 489

android设置背景格式,Android 设置 EditText 背景颜色、背景图片

Android 设置 EditText 背景颜色mView.findViewById(R.id.editText).setBackgroundResource(R.color.caution);Android 设置 EditText 背景图片(程序设置)其实这个不是背景,因为如果图片太大,它会挤大 EditText,并且它占用的地方也不能输入文字。float size = ((EditText)m...

weixin_39620662的博客 648

android设置背景颜色为蓝色,改变android中edittext的背景颜色

如果我使用以下代码更改我的EditText的背景颜色,它看起来像框缩小,并且它不会保留默认EditText存在的蓝色底边框的ICS主题。android:layout_width="fill_parent"android:layout_height="fill_parent"android:background="#99000000">android:id="@+id/id_nick_name...

weixin_39716877的博客 1153

editview设置android:width不起作用,【已解决】android中通过style的方式去设置EditText的背景色结果不起效果...

【问题】Android中,已经通过style中,已经搞定了:然后去设置了EditText的背景色:#D9D9D914spnormal@color/VariableLabelColor@color/Black@color/NonEditableBackgoundColor然后在代码中通过引用style去设置:EditText variableValueView = (EditText) variab...

weixin_42297810的博客 549

设置EditText背景图片

代码: android:layout_width="match_parent" android:layout_height="40dp" android:layout_margin="5dp" android:background="@drawable/edittext"       android:orientation="vertical" >      

Suzi的专栏 6346

android编辑框背景设计,如何在android中设置edittext的背景?

我找到了解决方案:text.xml:main.xml中:android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical" >android:id="@+id/editText1"android:background="@drawable/text"andr...

weixin_36125588的博客 421

设置自定义的Edittext的光标是否显示和被选中文字的背景色

如题,我自定义了Edittext,默认的话光标是显示的,但是当我通过代码设置光标不显示之后,则被选中的文字的背景色也随之消失。这是怎么回事,如何解决呢。。。请教一下了,有知道的帮忙下吧。在此谢过。myEditText.setCursorVisible(false);//设置是否显示光标myEditText.setHighlightColor(Color.BLUE);//设置被选中文字的背景色源码在

zhou699的专栏 3220

单机版APP记住密码功能的实现及EditText的输入框背景设置

今天记录两个小小的功能的实现,方便日后回顾。 所有的代码即便是自己一点点敲出来的,如果一个月两个月不看,也会忘记其具体实现的方法代码。正是因为之前疏于记录,导致有些东西再写的时候总是有卡壳的感觉,因此现在尽量在坚持着将遇到的一些小技巧,小功能的实现记录下来。正所谓“好记性不如烂笔头”。 言归正传。 首先将EditText输入框的背景设置写在这里。其实该背景框可以设置自定义的背景,也可以设置为

baidu_33714003的博客 1005

安卓开发如何设置(EditText)文本编辑框的背景透明 输入字符长度 自定换行等问题

<EditText android:id="@+id/editText" android:layout_width=“match_parent” android:layout_height=“wrap_content” android:background="@null" 该属性设置为@null可使控件背景颜色变成透明 android:digits=“0123456789...

qq_43765513的博客 2276

EditText设定文本背景实用需求

之前想做这样一个效果, 如图: [img]http://dl.iteye.com/upload/picture/pic/98913/fbfd6d9f-3831-314c-9aef-1cef1daf8c2c.png[/img] 之前的code: [code="java"]et = (EditText) findViewById(R.id.et); String tex...

蜗牛/ 的博客 404

在EditText中设置图片,背景为圆角,输入法弹出不影响activity原有布局...(一)

这是一个模仿的小例子,记录我在编写过程中所碰到的一些问题。 这个是最终效果  主要介绍上面的搜索布局是怎么实现的,注意的是该实现功能是在RelativeLayout布局下。咱们先在布局中放一个EditText控件,给父容器设置gravity为center,让EditText控件居中,并且给EditText的hint设置一个值。 android:gravity="center"

诺诺诺的言丶 1595

editText设置背景后,被软键盘覆盖

解决方法: 在AndroidManifest.xml文件中,对应的activity下添加 :android:windowSoftInputMode="stateVisible|adjustResize" 左图为正常情况下, 右图为被覆盖的截图:

yanjin_pang的博客 1065
上一篇: 百度经纬度坐标转换官方方法
下一篇: Android日期选择器DatePickerDialog的使用
杨小熊的笔记
博客等级 码龄15年 125粉丝 156原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值