首页
归档
留言
友链
广告合作
壁纸
更多
美女主播
Search
1
博瑞GE车机升级/降级
5,625 阅读
2
Mac打印机设置黑白打印
4,981 阅读
3
修改elementUI中el-table树形结构图标
4,905 阅读
4
Mac客户端添加腾讯企业邮箱方法
4,685 阅读
5
intelliJ Idea 2022.2.X破解
4,367 阅读
后端开发
HarmonyOS Next
Web前端
微信开发
开发辅助
App开发
数据库
随笔日记
登录
/
注册
Search
标签搜索
Spring Boot
Java
Vue
Spring Cloud
Mac
MyBatis
WordPress
MacOS
asp.net
Element UI
Nacos
MySQL
.Net
Spring Cloud Alibaba
Mybatis-Plus
Typecho
jQuery
Java Script
IntelliJ IDEA
微信小程序
Laughing
累计撰写
627
篇文章
累计收到
1,421
条评论
首页
栏目
后端开发
HarmonyOS Next
Web前端
微信开发
开发辅助
App开发
数据库
随笔日记
页面
归档
留言
友链
广告合作
壁纸
美女主播
搜索到
3
篇与
的结果
2020-12-06
android Button动态修改背景图
我们在布局文件中,设置Button的背景图片时,一般是通过如下方式<ImageButton android:id="@+id/buttonListTopMenuSave" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/detail_save" android:layout_centerVertical="true" android:layout_alignParentRight="true" />如果我们需要动态设置图片,可以通过如下方式buttonListTopMenuSave = findViewById(R.id.buttonListTopMenuSave); buttonListTopMenuSave.setBackgroundResource(R.drawable.detail_ok); buttonListTopMenuSave.setOnClickListener(this);
2020年12月06日
2,215 阅读
0 评论
1 点赞
2020-12-05
android Button修改背景色
问题描述在修改Button的背景颜色时,始终无法修改颜色为设置的颜色,且颜色始终为默认的蓝紫色。比如如下定义一个椭圆形的按钮。样式btn_bg_red.xml<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/teal_200"/> <corners android:topLeftRadius="10dip" android:topRightRadius="10dip" android:bottomRightRadius="10dip" android:bottomLeftRadius="10dip" /> <!--圆角矩形白色背景--> </shape>MainActivity.xml<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dip" android:layout_weight="1" android:background="@drawable/btn_bg_red" android:textColor="@color/purple_200" android:gravity="center" android:text="圆角Button" /> </androidx.constraintlayout.widget.ConstraintLayout>可以看到,虽然修改了背景色,但是根本没起作用。解决默认的颜色设置来自于res/values/themes.xml与夜间模式(应该是)下的res/values-night/themes.xml修改为(或其它能够实现非默认颜色的主题)
2020年12月05日
1,641 阅读
0 评论
0 点赞
2020-11-08
通过软连接解决Android studio不支持中文路径的问题
Android studio默认不支持中文路径,比较坑爹。但是我们路径中难免会出现中文路径。通过软连接解决这里提供一种思路,就是通过软件链接的方式进行解决。首先我们打开cmd窗口输入mklink /d C:\Users\laughing\link\companycode C:\Users\laughing\Seafile\私人资料库\公司资料\00.代码 ,前面的路径是要创建的链接路径,也就是不包含中文名的,后面的是原始的路径。这样我们后期在使用Android Studio时,直接使用不包含中文的路径即可
2020年11月08日
1,632 阅读
1 评论
15 点赞