手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >解析android中的帮助、about、关于作者、HELP等提示页面
解析android中的帮助、about、关于作者、HELP等提示页面
摘要:在android中,经常要用到帮助、about、关于作者等的提示页面。类似这样的页面:这样的页面,我们可以通过AlertDialog对话框来...

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

类似这样的页面:

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

这样的页面,我们可以通过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

复制代码 代码如下:

<?xml version="1.0" encoding="utf-8"?>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"

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

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

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

<TextView android:layout_height="fill_parent"

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

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

</ScrollView>

</FrameLayout>

2、strings.xml

复制代码 代码如下:

<string name="help_dialog_text">

<i>作者: 查字典教程网</i>

n

n

<i>联系:www.jb51.net</i>

n

n

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

n

n

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

</string>

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

new AboutDialog(this).show();

【解析android中的帮助、about、关于作者、HELP等提示页面】相关文章:

android开发中常用的Eclipse快捷键详细整理

android上的缓存、缓存算法和缓存框架详解

android平台中调用系统界面

android中的按两次返回键退出代码

Android中在控件上显示倒计时

android中实现指针滑动的动态效果方法

android 版本检测 Android程序的版本检测与更新实现介绍

解析离线安装Eclipse的Android ADT开发插件的具体操作(图文)

android打开应用所在的市场页面进行评分操作的方法

解析Android中使用自定义字体的实现方法

精品推荐
分类导航