您的位置:首页 > 移动开发

安卓Api Demo学习 app/Activity/CustomDialog

2011-10-22 20:07 302 查看
首先是AndroidManifest.xml中,关于Activity的配置

<activity android:name=".app.CustomDialogActivity"
android:label="@string/activity_custom_dialog"  //Label相当于Dialog的Title
android:theme="@style/Theme.CustomDialog">   //配置为Dialog风格
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>


custom_dialog_activity.xml中的内容,只是一个简单的TextView

<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text"
android:layout_width="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"       // 垂直水平居中
android:text="@string/custom_dialog_activity_text"/>


显示效果如下

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: