- 浏览: 50496 次
- 性别:
- 来自: 龙岩
最新评论
-
qq184234675:
脱裤子放屁,直接给方法加 start,limit俩参数不就行了 ...
mybatis association表关联与rowbounds共同使用时的异常及其解决方案 -
flzm:
我的在代码115行报错,是properties.get(&qu ...
Android数据存储之Files -
416849838:
.................
Android控件之-RadioGroup和RadioButton -
leesazhang:
受教了。谢谢!
Android学习之MVC模式 -
drager:
不是原版吧
Android界面布局
在android中经常也能用到dialog对话框
package com.ko8e; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; /** * 一个是通过AlertDialog.Builder 初始化dialog 然后再showDialog. * 另一个是通过将androidManifest.xml中的activity的属性设为android * :theme="@android:style/Theme.Dialog,伪装为dialog */ public class MyActivity extends Activity { /** Called when the activity is first created. */ ProgressDialog m_Dialog = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Dialog dialog = new AlertDialog.Builder(MyActivity.this) .setTitle("登录提示") .setMessage("这里需要登录") .setPositiveButton("确定", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { LayoutInflater factory = LayoutInflater.from(MyActivity.this); final View DialogView = factory.inflate(R.layout.dialog, null); AlertDialog dlg = new AlertDialog.Builder(MyActivity.this) .setTitle("登录框").setView(DialogView).setPositiveButton("确定", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int which) { m_Dialog = ProgressDialog.show( MyActivity.this, "请等待···", "正在为你登录···", true); new Thread() { public void run() { try { sleep(3000); } catch (Exception e) { e.printStackTrace(); } finally { m_Dialog.dismiss(); } } }.start(); } }).setNegativeButton("取消", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { MyActivity.this.finish(); } }).create(); dlg.show(); } }).setNegativeButton("退出", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { MyActivity.this.finish(); } }).create(); dialog.show(); } }
在这里使用到了两个xml来显示
main.xml:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>
dialog.xml:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/username" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dip" android:layout_marginRight="20dip" android:gravity="left" android:textAppearance="?android:attr/textAppearanceMedium" /> <EditText android:id="@+id/username" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dip" android:layout_marginRight="20dip" android:scrollHorizontally="true" android:autoText="false" android:capitalize="none" android:gravity="fill_horizontal" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/password" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dip" android:layout_marginRight="20dip" android:gravity="left" android:textAppearance="?android:attr/textAppearanceMedium" /> <EditText android:id="@+id/password" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dip" android:layout_marginRight="20dip" android:scrollHorizontally="true" android:autoText="false" android:capitalize="none" android:gravity="fill_horizontal" android:password="true" android:textAppearance="?android:attr/textAppearanceMedium" /> </LinearLayout>
发表评论
-
Eclipse插件
2011-04-28 15:35 2068相关JAR包: spring-framewo ... -
Android学习之MVC模式
2011-01-13 20:05 4386MVC是当前比较流行的框 ... -
Android学习之内存管理机制
2011-01-13 18:42 1160很多开发者都是从J2ME或 ... -
Android数据存储之SQLite
2010-12-29 00:28 1137这一节比较重要,SQLite是一个轻量级的数据库。 它的功能 ... -
Android数据存储之Network
2010-12-29 00:20 937这篇文章是转载的。。。 http://byandby.ite ... -
Android数据存储之Files
2010-12-29 00:13 974在默认状态下,文件是不能在不同的程序间共享的。用文件来存储数据 ... -
Android数据存储之SharePreference
2010-12-29 00:01 5303Shared Preferences:是用来存储“key-va ... -
Android之Handler的使用
2010-12-14 23:58 857Handler的使用: 由于Handler运行在主线 ... -
Android界面布局
2010-12-14 23:53 13871.Linearlayout:这个很常见,线性布局.大多数情况 ... -
Android控件之-Notification
2010-12-14 23:45 861状态栏提示 package com.ko8e; imp ... -
Android控件之-ProgressDialog
2010-12-14 23:42 1098对话框中的拖动条 package com.ko8e; ... -
Android控件之-SeekBar
2010-12-14 23:40 1641拖动条类似于进度条,但是进度条不可以控制。 拖动条可以被用户 ... -
Android控件之-ProgressBar
2010-12-14 23:30 1324Android手机中进度条的使用主要是两种,分别是长形进度条和 ... -
Android控件之-ImageSwitcher
2010-12-14 23:26 991切换图片,在Android手机应用中也经常使用: packa ... -
Android控件之-Gallery
2010-12-14 23:19 809Android拖动图片: package ... -
Android控件之-Menu
2010-12-14 23:10 946Android中的菜单项,在Android中有个Menu按钮。 ... -
Android控件之-DatePicker和TimePicker
2010-12-14 23:04 1137显示日期和时间 这两个类很经常用得到 package co ... -
Android控件之-AutoComplete-TextView
2010-12-14 22:57 2275很多textField里面都有这种自动提示的功能: 当你输入 ... -
Android控件之-Spinner
2010-12-14 22:53 1365Android中的下拉菜单,用起来也挺舒服的。 packag ... -
Android控件之-CheckBox
2010-12-14 22:51 1434多项选择的组件主要是由CheckBox组成的 package ...
相关推荐
•Android---UI篇---Dialog(对话框) • •Android---UI篇---AutoCompleteTextView(自动提示) • •Android---UI篇---Toast(提示) • •Android---UI篇---Button(按钮) • •Android---UI篇---TextView...
dialog库,可以在任意类内调用,子线程或ui线程内均可显示
Android仿IosDialog控件
Android自定义控件:可重用的自定义Dialog类
自定义Dialog 模拟popupwindow功能,随意改变Dialog位置。可以简单设置Dialog位于某个控件的上方、下方、左边、右边。
Dialog 很经常用到的一个控件,但大多时候系统默认的样式是不满足于项目使用的,故自定义了一套合适的Dialog模板方便日常使用。
文档介绍了Android开发教程之一:控制Dialog 的背景方法,1.定义一个无背景主题主题,2.创建Dialog,二:控制Dialog 以及内部控件的背景方法,Android开发教程之三:去掉边框、title 等参数
dialog放在某个控件的下面
省市区三级联动选择dialog 参考了该作者的项目https://github.com/duanhong169/PickerView 做了细微的修改 变成对话框 用起来很简单
Dialog是常用的一种Android控件,一般常用的形式有几种。
自己整理的自定义控件方法,看了你就会做自定义Dialog和Toast了,没有多余代码,很简洁。背景、按钮都能自定义
由于Android构建在开源代码的框架之上,而且提供了强大的SDK库和开放的理念,所以它为广大的没有任何移动应用程序开发经验的新手开辟了一条开发完美的移动应用程序的康庄大道。而富有经验的移动开发人员现在也可以...
BubbleView for Android 中文版README BubbleView is a control/container with an arrow for Android, which can be fully customized by code or XML layout file. Arrow direction: up, down, left, right or ...
点击ListView的item弹出Dialog,点击Dialog的某个控件,更改item的值。
Dialog是我们做项目很常见的一项功能点了,一般的文字弹窗原生的dialog就可以帮我们实现,然而在实际开发过程中,因为弹窗布局较为复杂,充斥着各种控件,这时候原生的Dialog显然就不能满足我们的需求了,所以我们要...
完美日历完美日历选择器 多种日历样式 其中添加了动画效果完美日历选择器 多种日历样式 其中添加了动画效果完美日历选择器 多种日历样式 其中添加了动画效果选择器 多种日历样式 其中添加了动画效果
自定义dialog肯定是用的很多了 但是感觉每次做都是很乱单纯完成任务而已,现在封装了一下以后用到直接copy,需要的朋友可以参考下
|--android 挪动dialog的位置 |--android 控制对话框位置 |--android 根据uri获取路径 |--android 模拟器错误 |--android 横竖屏切换 |--android 获取mac地址 |--android 获取sd卡状态 |--android 设置apn |--...
Dialog对话框,Button按钮,EditText输入框,gridview相关,SQLite,WebView浏览器,wifi蓝牙JBox2D相关,Tab选项卡,Widget小组件