android的帮助、about、关于作者、HELP等的提示页面
16lz
2021-12-04
android的帮助、about、关于作者、HELP等的提示页面
在android中,经常要用到帮助、about、关于作者等的提示页面。
类似这样的页面:
这样的页面,我们可以通过AlertDialog对话框来设计。
设计一个AboutDialog类继承于AlertDialog
public class AboutDialog extendsAlertDialog { publicAboutDialog(Context context) { super(context); finalView view = getLayoutInflater().inflate(R.layout.about, null); setButton(context.getText(R.string.close), (OnClickListener)null); setIcon(R.drawable.icon_about); setTitle("超级笑话 v1.0.0"); setView(view); } }
对应的XML文件
1、layout布局文件about.xml
<?xml version="1.0"encoding="utf-8"?>
2、strings.xml
作者: 空山不空 \n \n 联系:ajie191@163.com \n \n 超级笑话---收集了2000多各种类型的笑料,让你全天笑不停!你还可以把笑话通过短信发给你的好友分享哦! \n \n 有任何建议或者反馈可以随时联系作者
然后在页面调用代码即可显示对话框
new AboutDialog(this).show();
更多相关文章
- Android(安卓)Intent实现页面跳转的方法示例
- android 值得学习的网站
- Your content must have a ListView whose id attribute is 'and
- 用CSS3生成的一个漂亮的android客户端页面
- 安卓入门及界面带参数跳转
- Android开机自启动程序
- Android(安卓)ViewPager多页面滑动切换以及单页卡内添加事件
- android WebView总结
- Android底部导航栏+消息提醒