android 常用代码
<span style= "color: rgb(255, 0, 0);" > // 新建一个toast对象</span> private Toast toast; public void showMsg(String arg) { if (toast == null ) { toast = Toast.makeText( this , arg, Toast.LENGTH_SHORT); } else { toast.cancel(); toast.setText(arg); } toast.show(); } |
res/drawable目录下面建立一个设置圆角边框参数的xml文件,如下:
corner_round.xml:
[[73539]]
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:Android="http://schemas.android.com/apk/res/android" > <solid android:color="#FFCC33" /> <corners android:radius="10dp" /> </shape>
[[73539]]
调用:android:background="@drawable/corner_round"
【编辑推荐】
- android 录像/打开video文件
- Android程序开发的环境配置
- 91分析Android与IOS游戏及软件下载比例数据
版权声明:
作者:后浪云
链接:https://www.idc.net/help/205617/
文章版权归作者所有,未经允许请勿转载。
THE END