android小细节
来源:互联网 发布:基于mac的acl 编辑:程序博客网 时间:2024/05/18 02:44
<style name="Theme.Translucent.NoTitleBar"> <item name="windowNoTitle">true</item> <item name="windowContentOverlay">@null</item></style>
1.在引导页加上以上代码,可以一开始就显示背景图,而不显示白色背景。
以及去除引导页title.
2.ListView
android:clipToPadding用于ListView滑动时忽略padding。
3.actionBar更改返回图标的方法:
1.要求API版本大于18
ActionBar ab = getSupportActionBar(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeAsUpIndicator(R.drawable.ic_menu);2.更改样式
在style.xml文件中新增样式
<style name="style_normal" parent="Theme.AppCompat.Light"> <item name="android:homeAsUpIndicator">@drawable/back</item> <!--返回icon--> </style>
然后在Activity中使用该样式
4.Toast频繁显示
可以自己实现帮助类,每次使用Toast都是对同一个Toast进行设置
public class ToastHelper { public static Toast toast = null; public static void showToast(Context context,String content,int duration){ if(toast == null){ toast = Toast.makeText(context,content,duration); }else{ toast.setText(content); toast.setDuration(duration); } toast.show(); } public static void cancelToast(){ if(toast != null){ toast.cancel(); } }}
0 0
- android开发小细节
- android 小细节1
- android-小细节
- Android 中的小细节
- Android开发小细节
- android小细节
- 总结一些小细节 ---- Android
- Android动态壁纸小细节
- android小细节-imagebutton 替换
- 做Android缓存小细节
- 兔子--android开发小细节
- Android开发的小细节
- Android---不注意的小细节
- android 中的一些小细节
- android 开发一些小细节
- Java Android开发小细节
- android开发小细节笔记
- Android小项目之八 界面细节
- 136. Single Number
- 自定义Toast
- ffmpeg处理RTMP流媒体的命令大全
- Spring系列(3/1)---交互的一种尝试
- PL/SQL开发常见SQL知识
- android小细节
- leetcode503 Next Greater Element II java
- Android跨应用Activity跳转
- caffe在prototxt文件加参数
- Spring系列(3/2)---交互的改进
- 求职旺季,你可能遇到的五大“惨案”
- 关于初始化列表的问题
- js 保存密码--记住我
- 消息盒子管理