---
title: "Android漂亮的Help提示框"
author: "fonter"
date: "2010-05-25T13:25:16Z"
tags: []
categories: ["移动开发"]
slug: "android-help"
draft: false
lastmod: "2010-05-25T13:28:17Z"
id: 674890
url: "https://fonter.iteye.com/blog/674890"
---

示图

 

![](http://dl.iteye.com/upload/attachment/254417/1fb7efe0-466a-3992-acf8-71880867b473.jpg)

 

```
import android.app.AlertDialog;
import android.content.Context;
import android.view.View;

import com.iwidsets.task.manager.R;

public class HelpDialog extends AlertDialog {
	public HelpDialog(Context context) {
		super(context);
		final View view = getLayoutInflater().inflate(R.layout.help_dialog,
				null);
		setButton(context.getText(R.string.close), (OnClickListener) null);
		setIcon(R.drawable.icon);
		setTitle("AndTask version:" + R.string.version);
		setView(view);
	}
}
```

 

 

help\_dialog.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" />
	</ScrollView>
</FrameLayout> 
```

 

help\_dialog\_text 文本

 

```
	<string name="help_dialog_text">
		<i>Author: fonter.yang</i>
		\n
		<i>
			<a href="http://www.iwidsets.com">http://www.iwidsets.com</a>
		</i>
		\n
		\n
		<i>AndTask - Android Task Manager</i>
		\n
		It is an easy-to use task management software,it allows you to switch on or off running programs/apps/services.
		\n
		\n
		<b>Feature</b>
		\n
		1) Switch and Stop Tasks/Processes/Apps/Services
		\n
		2) Shows Memory Info and Apps Info
		\n
		3) Uninstall Apps
	</string>
```

 

显示

 

```
new HelpDialog(this).show(); 
```