android 关于页面,解析android中的帮助、about、关于作者、HELP等提示页面

在android中,经常要用到帮助、about、关于作者等的提示页面。

类似这样的页面:

2c2d0cb2e0a5611d8567b863ec479b3b.png

这样的页面,我们可以通过AlertDialog对话框来设计。

设计一个AboutDialog类继承于AlertDialog

public class AboutDialog extends AlertDialog {

public AboutDialog(Context context) {

super(context);

final View 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

android:layout_width="fill_parent" android:layout_height="wrap_content">

android:layout_width="fill_parent" android:layout_height="fill_parent">

android:layout_width="fill_parent" android:text="@string/help_dialog_text"

android:padding="6dip" android:textColor="#FFFFFF" />

2、strings.xml

作者: 脚本之家

\n

\n

联系:www.jb51.net

\n

\n

超级笑话---收集了2000多各种类型的笑料,让你全天笑不停!你还可以把笑话通过短信发给你的好友分享哦!

\n

\n

有任何建议或者反馈可以随时联系作者

然后在页面调用代码即可显示对话框

new AboutDialog(this).show();

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值