android 弹出窗口
来源:互联网 发布:重庆编程招聘 编辑:程序博客网 时间:2024/05/16 07:24
正常的Dialog弹出窗口,当点击窗口外围时关闭弹出的窗口,这个在很多弹出式的Activity上很为实用!
dialog.xml 弹出窗口的界面布局:
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:gravity="center_vertical|center_horizontal">
- <LinearLayout
- android:id="@+id/layout"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:background="@drawable/dialog_bg">
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:padding="20px"
- android:text="这是内容"
- />
- </LinearLayout>
- </LinearLayout>
弹出窗口的Activity:
- package com.xmz.activity;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.MotionEvent;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.widget.LinearLayout;
- public class DialogActivity extends Activity {
- private MyDialog dialog;
- private LinearLayout layout;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.dailog);
- dialog=new MyDialog(this);
- layout=(LinearLayout)findViewById(R.id.layout);
- layout.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- }
- });
- }
- @Override
- public boolean onTouchEvent(MotionEvent event){
- finish();
- return true;
- }
- }
工程资源下载地址:http://download.csdn.net/source/3399984
- android 弹出窗口
- android 弹出层,窗口
- android 弹出窗口
- android 弹出窗口
- Android弹出窗口PopuWindow
- Android弹出窗口PopupWindow
- android弹出窗口实现
- Android 弹出窗口 PopupWindow
- android 自定义弹出窗口
- android 弹出窗口
- android-PopupWindow弹出窗口 - 随心
- android 各种常用弹出窗口
- Android 弹出窗口 定时关闭
- android弹出窗口的实现
- Android的弹出窗口设置
- android 弹出窗口 - 正常的Dialog弹出窗口
- Android登录对话框,Android弹出登录窗口
- android edittext弹出输入法的窗口问题
- 砌墙的差距
- MySQL中修改密码及访问限制设置详解
- Splunk Remote Root Exploit
- MYSQL常用命令
- HorizontalScrollView实现Gallery
- android 弹出窗口
- android 实现图片的边框
- 最近在S5pv210的平台的一些wince驱动完善进展情况(作者:gooogleman)
- 如何处理“AfxMessageBox” 2 个重载中没有一个可以转换所有参数类型?
- android 实现左右拖动的网页焦点图
- Sql server 2005日志文件太大,使其减小的方法
- Android中的资源与国际化!
- 修改已安装VS2010帮助文档位置
- VI详细命令