Android 漂亮的提示框
日期:2016/3/13 17:14:14   編輯:開發入門
效果圖:
Java代碼:
- 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);
- }
- }
Java代碼:
- <?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>
Java代碼:
- <string name="help_dialog_text">
- <i>Author: fonter.yang</i>
- \n
- <i>
- <a href=http://>http://</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>
最後我們來顯示
Java代碼:
- new HelpDialog(this).show();
- 上一頁:Android開發必備武器,處理XML的利器--SAX快速上手
- 下一頁:Android NDK環境搭建(Windows環境)