Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發 >> 開發入門 >> Android 漂亮的提示框

Android 漂亮的提示框

編輯:開發入門

效果圖:

1.jpg



Java代碼:

  1. import android.app.AlertDialog;
  2. import android.content.Context;
  3. import android.view.VIEw;
  4. import com.iwidsets.task.manager.R;


  5. public class HelpDialog extends AlertDialog {
  6. public HelpDialog(Context context) {
  7. super(context);
  8. final View vIEw = getLayoutInflater().inflate(R.layout.help_dialog,null);
  9. setButton(context.getText(R.string.close), (OnClickListener) null);
  10. setIcon(R.drawable.icon);
  11. setTitle("AndTask version:" + R.string.version);
  12. setView(vIEw);
  13. }
  14. }

Java代碼:
  1. <?XML version="1.0" encoding="utf-8"?>
  2. <FrameLayout XMLns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="fill_parent" android:layout_height="wrap_content">
  4. <ScrollVIEw XMLns:android="http://schemas.android.com/apk/res/android"
  5. android:layout_width="fill_parent" android:layout_height="fill_parent">
  6. <TextVIEw android:layout_height="fill_parent"
  7. android:layout_width="fill_parent"
  8. android:text="@string/help_dialog_text"
  9. android:padding="6dip" />
  10. </ScrollVIEw>
  11. </FrameLayout>

Java代碼:
  1. <string name="help_dialog_text">
  2. <i>Author: fonter.yang</i>
  3. \n
  4. <i>
  5. <a href=http://>http://</a>
  6. </i>
  7. \n
  8. \n
  9. <i>AndTask - android Task Manager</i>
  10. \n
  11. It is an easy-to use task management software,it allows you to switch on or off running programs/aPPS/services.
  12. \n
  13. \n
  14. <b>Feature</b>
  15. \n
  16. 1) Switch and Stop Tasks/Processes/APPS/Services
  17. \n
  18. 2) Shows Memory Info and APPS Info
  19. \n
  20. 3) Uninstall APPS
  21. </string>

最後我們來顯示

Java代碼:
  1. new HelpDialog(this).show();

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved