会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
平安喜乐
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
27
下一页
2021年9月29日
9.29
摘要: AlertDialog(对话框): Step 1:创建AlertDialog.Builder对象; Step 2:调用setIcon()设置图标,setTitle()或setCustomTitle()设置标题; Step 3:设置对话框的内容:setMessage()还有其他方法来指定显示的内容;
阅读全文
posted @ 2021-09-29 13:08 平安喜乐v
阅读(48)
评论(0)
推荐(0)
2021年9月28日
9.28
摘要: Toast完全自定义: private void midToast(String str, int showTime) { LayoutInflater inflater = getLayoutInflater(); View view = inflater.inflate(R.layout.vie
阅读全文
posted @ 2021-09-28 18:29 平安喜乐v
阅读(112)
评论(0)
推荐(0)
2021年9月27日
9.27
摘要: 通过构造方法来定制Toast: private void midToast(String str, int showTime) { Toast toast = Toast.makeText(mContext, str, showTime); toast.setGravity(Gravity.CENT
阅读全文
posted @ 2021-09-27 09:28 平安喜乐v
阅读(74)
评论(0)
推荐(0)
2021年9月24日
9.24
摘要: 直接调用Toast类的makeText()方法创建: void midToast(String str, int showTime) { Toast toast = Toast.makeText(global_context, str, showTime); toast.setGravity(Gra
阅读全文
posted @ 2021-09-24 19:27 平安喜乐v
阅读(31)
评论(0)
推荐(0)
2021年9月23日
9.23
摘要: 隐藏滑动条: 我们可以通过设置:android:scrollbars="none" 或者 setVerticalScrollBarEnabled(true); 解决这个问题
阅读全文
posted @ 2021-09-23 17:21 平安喜乐v
阅读(66)
评论(0)
推荐(0)
2021年9月22日
9.22
摘要: 设置点击颜色cacheColorHint: 如果你为ListView设置了一个图片作为Background的话,当你拖动或者点击listView空白位置会发现 item都变成黑色了,这是时候我们可以通过这个cacheColorHint将颜色设置为透明:#00000000
阅读全文
posted @ 2021-09-22 07:25 平安喜乐v
阅读(57)
评论(0)
推荐(0)
2021年9月21日
9.21
摘要: 表头表尾分割线的设置: listview作为一个列表控件,他和普通的列表一样,可以自己设置表头与表尾: 以及分割线,可供我们设置的属性如下: footerDividersEnabled:是否在footerView(表尾)前绘制一个分隔条,默认为true headerDividersEnabled:是
阅读全文
posted @ 2021-09-21 18:01 平安喜乐v
阅读(62)
评论(0)
推荐(0)
2021年9月20日
9.20
摘要: 自定义BaseAdapter,然后绑定ListView的最简单例子: 代码示例: /** * Created by Jay on 2015/9/18 0018. */ public class Animal { private String aName; private String aSpeak;
阅读全文
posted @ 2021-09-20 19:06 平安喜乐v
阅读(112)
评论(0)
推荐(0)
2021年9月17日
9.17
摘要: 实现代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pare
阅读全文
posted @ 2021-09-17 23:22 平安喜乐v
阅读(79)
评论(0)
推荐(0)
2021年9月16日
9.16
摘要: SimpleAdapter使用示例: 实现代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layou
阅读全文
posted @ 2021-09-16 07:21 平安喜乐v
阅读(75)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
27
下一页
公告