E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
getBackground
Android设置控件的透明度(半透明效果)
2.使用方法(1)java代码实现:text=(TextView)findViewById(R.id.text);text.
getBackground
().setAlpha(12);12setAlpha
xiesen
·
2023-12-04 03:02
android textview背景透明度,Android TextView文字透明度和背景透明度设置
textview1.setTextColor(Color.argb(255,0,255,0));//文字透明度控件设为半透明:控件名.
getBackground
().setAlpha(int);int在
那个吴小明
·
2023-11-15 06:20
android
textview背景透明度
Android中设置颜色透明度
2.在代码中用的话就是用Java代码设置是这样设置的Viewv=findViewById(R.id.content);//找到你要设透明背景的layout的idv.
getBackground
().setAlpha
鸟儿不吃草
·
2023-11-15 06:49
android
android
【Android】设置View 透明度
设置View透明度两个方法:view.setAlpha(floatalpha)与view.
getBackground
().setAlpha(intalpha)1、view.setAlpha(floatalpha
Chelsea0522
·
2023-11-15 06:48
Android
android
Java 给Word不同页面设置不同背景
Word文档中,可直接通过【设计】-【页面颜色】页面颜色,通过Java代码可参考如下设置方法:1.设置单一颜色背景doc.
getBackground
().setType(BackgroundType.Color
Eiceblue
·
2023-10-26 15:30
Java
Word
Java
Word
页面背景
jar
Maven
background tint颜色渲染
在代码中动态设置intcolorSelect=Color.parseColor("#FFA83F");intcolorUnSelect=Color.parseColor("#1Effffff");ctTab.
getBackground
趁早Super
·
2023-10-15 04:26
Android中设置控件透明度的方法
三、透明度数值表一、Java中setAlpha设置Viewv=findViewById(R.id.content);v.
getBackground
().setAlpha(100);说明:0~255透明度值
ambitionLlll
·
2023-09-26 19:25
mf项目
android
git
android
Android 值得记录的几个点
的背景颜色TextViewtest=(TextView)findViewById(R.id.tv_test);GradientDrawabledrawable=(GradientDrawable)test.
getBackground
IT一书生
·
2023-07-17 23:50
Android设置透明、半透明等效果
例如设置按钮Java代码2、用ARGB来控制Java代码半透明透明3、设置alphaJava代码Viewv=findViewById(R.id.content);//找到你要设透明背景的layout的idv.
getBackground
mingtingjie
·
2023-04-17 23:46
android
Activity Toolbar 设置透明度后影响到其他页面
原本在自定义Toolbar中方法如下:publicvoidsetBackGroundAlpha(floatalpha){Drawablebackground=
getBackground
();if(null
Mocaris
·
2023-03-26 09:56
android 改变button背景颜色,android button 代码设置背景色
importandroid.graphics.drawable.ColorDrawable;privateDrawabledrawable_backup;drawable_backup=pauseBtn.
getBackground
洋葱庄
·
2023-03-15 10:20
android
改变button背景颜色
Android学习之帧动画和视图动画
通过view.
getBackground
()方法获取到view上的帧动画,然后通过AnimationDrawa
wmxz520
·
2023-03-12 17:36
Android
android
学习
动画
ColorDrawable系统缓存的问题
通过如下尝试,有如下现象:1.1:代码view.
getBackground
()去获取两
PeytonWu
·
2021-05-14 13:53
获取imageview里的Bitmap
imageView.
getBackground
(),是获取它的背景图片;在调用getDrawingCache的时候要注意下面2点:在调用getDrawingCache()方法从ImageView对象获取图像之前
奚华
·
2020-09-17 08:09
Android
Android图片代码换色,背景换色
获取背景或者DrawableTextViewimageView=helper.getView(R.id.bg);imageView.setBackground(tintDrawable(imageView.
getBackground
南城故事北边跑
·
2020-09-16 16:43
Android
android
android更改布局的透明度时其他布局的透明度也跟着变化
这个在5.0以下,我测试的是4.4机型,没有问题:使用title_rl.
getBackground
.setAlpha(alpha);(alpha的取值范围0~255);然后在5.0的机型尚进行测试,其他的布
fingersorry
·
2020-09-15 13:33
Android手记
Android Shape绘制实用圆圈,并动态改变圆点的颜色
动态设置颜色TextViewtextView=(TextView)findViewById(R.id.ss);GradientDrawablemm=(GradientDrawable)textView.
getBackground
CS-晨曦
·
2020-09-15 11:19
android
android imageView背景透明度的设置
经过项目测试,有两种方法可以使用:1ivIcon.
getBackground
().setAlpha(NOT_ENABLED_ALPHA);2AlphaAnimationalpha=newAlphaAnimation
友谊路一霸
·
2020-09-14 15:33
android开发
Android
getBackground
().setAlpha 导致其他布局透明度发生变化
titleView.
getBackground
().mutate().setAlpha(255);在布局中多个控件同时使用一个资源的时候,这些控件会共用一个状态,例如ColorState,如果你改变了一个控件的状态
八戒卖萌-全栈开发工程师
·
2020-09-14 03:01
LightingColorFilter笔记
今天在http://stackoverflow.com网站上看到了别人修改button的颜色,点击效果什么的,突然看到可以用button.
getBackground
().setColorFilter(newLightingColorFilter
fancylovejava
·
2020-08-26 12:47
Android
安卓PNG图片着色以及透明度设置
图片着色要选择纯色图片,否则图片会严重失真,如下图原图:结果图:2.透明度设置:privatevoidsetBg(ImageButtonimageButton){//0~255透明度值imageButton.
getBackground
阿瑟与非
·
2020-08-24 08:25
Android
getBackground
().setAlpha导致所有资源都有变化
用到了
getBackground
().setAlpha来设置透明度,然后出现了引用相同资源的控件也有了透明度变化。找了资料,有效解决方法就一个函数。
Piitw
·
2020-08-23 10:51
Android
Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null o
给background设置透明度时总是报这个错,如图最后发现原来
getBackground
().setAlpha(0);方法没问题,是你设置对应的控件或者布局并没有background这个属性,加上就没问题了
十年之后2020
·
2020-08-22 17:13
Android
获取imageView的图和背景图
对应src属性)img2.setImageDrawable(img1.getDrawable());背景(对应background属性)img2.setBackgroundDrawable(img1.
getBackground
weixin_30815427
·
2020-08-20 19:07
Android Drawable的ConstantState共享问题解决,并从源码层分析其原因
在平时开发中,我们有时候会用到设置图片的透明的功能,不假思索的情况下,我们自然就会通过设置
getBackground
().setAlpha(XXX)来去达到我们的目的,但是我们后续会发现白色背景变成透明的状况
HunkWangshao
·
2020-08-20 13:00
android开发
webview设置背景色
然后在java代码中添加如下代码:wv.setBackgroundColor(0);//设置背景色wv.
getBackground
().setAlpha(0)
wulizhou
·
2020-08-20 13:24
webview
Android设置透明、半透明等效果
例如设置按钮Java代码2、用ARGB来控制Java代码半透明透明3、设置alphaJava代码Viewv=findViewById(R.id.content);//找到你要设透明背景的layout的idv.
getBackground
吴小博
·
2020-08-13 16:54
view
Android篇-更改shape背景颜色
在点击数字键盘时,改变对应圆点背景为选中色1、shape文件2、Activity相应监听事件中修改solid对应的颜色GradientDrawablegdOne=(GradientDrawable)view.
getBackground
KeeySir
·
2020-08-10 14:13
Android
Android背景设置透明和半透明效果
例如设置按钮Java代码2、用ARGB来控制Java代码半透明透明3、设置alphaJava代码Viewv=findViewById(R.id.content);//找到你要设透明背景的layout的idv.
getBackground
tiankongchengS
·
2020-08-10 01:29
android开发
爱收集
android
StateListDrawable cannot be cast to android.graphics.drawable.GradientDrawab
错误的写法:GradientDrawablegradientDrawable=((GradientDrawable)((TextView)helper.getView(R.id.tv_subject)).
getBackground
不倒翁姑娘
·
2020-08-09 17:11
view
Android buttom textview 颜色平滑过渡的动画效果
在这一点上,你可以通过执行启动代码中的过渡:TransitionDrawabletransition=(TransitionDrawable)viewObj.
getBackground
()
软件开发积累
·
2020-08-07 14:46
Android
Android在xml中设置组件风格(圆角,点击效果selector,边框,进度条风格,动画)TextView文字透明度
Drawableresourcefile”,命名为:btn_corners(表示功能:圆角button)2.在btn_corners.xml文件中写入代码如下3.TextView中文字透明度设置【半透明透明v.
getBackground
风正吹
·
2020-08-04 09:17
Android基础
android 动态添加自定义TextView
//设置背景图textView.setBackgroundResource(R.drawable.block_text_backgroumg);//设置背景透明度textView.
getBackground
iteye_11788
·
2020-08-03 17:06
android 简单帧动画
在布局中调用3.java中创建一个动画AnimationDrawableanimationDrawable;animationDrawable=(AnimationDrawable)imageView.
getBackground
莫空0000
·
2020-08-03 07:03
drawable效果
Android自定义View获取background的颜色和图片
而不是自定义属性.获取并修改background的内容如下(以自定义TextView为例):paint=newPaint();paint.setAntiAlias(true);Drawablebackground=
getBackground
毛大姑娘
·
2020-08-03 05:16
android开发
Android DrawableAnimation逐帧动画加载多图(OOM的解决)
ImageView的backgroud,然后在Activity里面[java]viewplaincopyanimationDrawable=(AnimationDrawable)mImageView.
getBackground
傻也不懂
·
2020-08-03 01:32
Android技术
android解决设置
getBackground
().setAlpha()后其他页面background也随之改变问题
动态设置控件setAlpha()但出现了一个问题A控件引用color1B控件也引用了color1改变A的AlphaB控件也随之改变;解决方案:第一种:重新创建一个color2,两个控件引用不同资源第二种:A.
getBackground
Tager丶
·
2020-08-01 01:46
android
android常见问题
动态的修改xml中的drawable文件的solid颜色
runtime环境下动态的随机的修改xml中drawable文件的颜色可以通过以下方法GradientDrawablebackground=(GradientDrawable)titleTextView.
getBackground
MARGI3
·
2020-08-01 01:34
Android
Step
Android GradientDrawable动态设置背景色、圆角
GradientDrawablegd=(GradientDrawable)view.
getBackground
();gd.setColor("#67943
adayabetter
·
2020-07-31 15:55
Android
UI
开发总结
android 动态生成shape以及动态的改变shape颜色
1>.改变shape的颜色(1)GradientDrawableview_ground=(GradientDrawable)view.
getBackground
();//获取控件的背景色(2)view_ground.setColor
雲焘
·
2020-07-31 13:41
android动画总结
一帧一帧的图片连续播放就是一个帧动画主要用于重复显示某些画面用法:1.animation_list2.必须寄生在一个控件上3.view.setbackgroundResource;设置帧动画列表4.需要让动画动起来(AnimationDrawbler)view.
getBackground
android_lyp
·
2020-07-27 18:27
android总结
动画
控件
android
2020-07-18工作日志
PPT及更改背景颜色及输出~//新建文件XMLSlideShowppt=newXMLSlideShow();//创建幻灯片XSLFSlideslide=ppt.createSlide();slide.
getBackground
生命在于学习
·
2020-07-19 09:32
图片设置level-list,根据不同状态显示不同图片
android:maxLevel必须从0递增,顺序错误后只会显示第一张图片布局文件代码中使用LevelListDrawablepauseDrawable=(LevelListDrawable)yourwiget.
getBackground
青楼爱小生
·
2020-07-16 02:20
AnimationDrawable
findViewById(R.id.ivs);view.setBackgroundResource(R.drawable.icon);AnimationDrawableas=(AnimationDrawable)view.
getBackground
SmallTwo
·
2020-07-13 23:34
Android中帧动画在Activity启动时自动运行的几种方式
findViewById(R.id.animation_view);iv.setBackgroundResource(R.drawable.animation);ad=(AnimationDrawable)iv.
getBackground
yueyue890327
·
2020-07-12 18:33
android
慎用alpha值——setAlpha与
getBackground
.setAlpha的差别
最近在做Android项目时,需要给控件添加一个外边框,该控件中的页面布局文件如下所示:边框的样式如下图所示:一个白色的衬底,外面有8dp的绿色边框另外还在drawable文件中添加了一个selector,用来选择当控件获得焦点时的背景样式:我们使用外边框时,为了让外边框显示出来,通常都要在父控件上添加android:clipChildren="false"android:clipToPaddin
饿了,吃包子
·
2020-07-09 22:45
android学习
Android给背景颜色设置Alpha 的坑
/***动画*/{//****一些逻辑mToolbar.
getBackground
().setAlpha(alpha);}刚开始只觉得很怪,后来发现当前界面设置的背景跟这个设置alpha背景颜色一样的全部跟当初设定的不一样
maike_even
·
2020-07-09 20:54
Android WebView工作中遇到的问题记录
WebView基础问题WebView设置背景透明颜色:在xml中设置background不一定起作用,在代码中设置webView.setBackgroundColor(0);//设置背景色webView.
getBackground
倚窗为听雨
·
2020-07-09 17:46
Android
WebView
Android shape 资源工具类GradientDrawable的使用说明,小坑一个
在项目中需要动态的更改背景颜色,于是乎想到了使用GradientDrawable这个类来改变控件的背景颜色,使用起来很简单,前提是view的background属性为shapeAGradientDrawablegd=view.
getBackground
凡人不羡仙
·
2020-07-09 13:49
android
关于安卓setBackgroundColor中Drawable复用导致背景重复改变
ItemTouchHelper.ACTION_STATE_DRAG){if(background==null&&bkcolor==-1){Drawabledrawable=viewHolder.itemView.
getBackground
z860368871
·
2020-07-09 04:18
Android
上一页
1
2
3
4
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他