最新文章列表

[Anko]使用anko alert示例

alert { customView { verticalLayout { //对话框标题 toolbar { id = R.id.dialog_toolbar lparams(width = matchParent, height ...
繁星水 评论(0) 有1066人浏览 2018-05-16 16:55

[Android]接收Push Notification及弹出Dialog

1、使用一个service接收gcm public class MyGcmListenerService extends GcmListenerService { private static final String TAG = "MyGcmListenerService"; /** * Called when message i ...
繁星水 评论(0) 有2144人浏览 2017-03-21 18:06

AlertDialog5种默认Theme对应的样式

  Dialog alertDialog = new AlertDialog.Builder(this,AlertDialog.THEME_TRADITIONAL) .setTitle(R.string.msg_dialog_title) .setPositiveButton("确定", null) .setNegativeButton(&quo ...
dengzh 评论(0) 有15573人浏览 2016-06-26 11:03

android AlertDialog标准化

public void createConfirmDialog(Activity activity, String message){ AlertDialog.Builder alert = new AlertDialog.Builder(activity); alert.setTitle(message) .setPositiveButton(activit ...
andyxrl 评论(0) 有670人浏览 2015-01-16 13:24

Android 让AlertDialog 在点击确定、取消时不消失

    AlertDialog类用于显示对话框。关于AlertDialog的基本用法在这里就不详细介绍了,网上有很多,读者可以自己搜索。那么本文要介绍的是如何随心所欲地控制AlertDialog。   这里有两种修改方式:   方法一: 这种方法需要用点技巧。由于系统通过调用dismiss来关闭对话框,那么我们可以在dismiss方法上做点文章。在系统调用dismiss方法时会首先判断对 ...
davidforit 评论(0) 有4129人浏览 2014-10-31 17:46

过期API_AlertDialog

layout-------------------------------------------------------activity_main.xml <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/screen&q ...
fangyong2006 评论(0) 有1137人浏览 2014-03-02 10:07

android学习笔记——AlertDialog

    AlertDialog的构造方法全部是Protected的,所以不能直接通过new一个AlertDialog来创建出一个AlertDialog。所以要创建一个AlertDialog,就要用到AlertDialog.Builder中的create()方法。 使用AlertDialog.Builder创建对话框常用方法 setTitle为对话框设置标题setIcon为对话框设置图标setMess ...
yangmeng_3331 评论(0) 有923人浏览 2014-01-13 15:42

Dialog的使用

 在Android中经常会使用到对话框Dialog。下面是实现一个基本的Dialog的代码: private void showDialog(){ LayoutInflater layoutInflater = this.getLayoutInflater(); View customDialog = layoutInflater.inflate(R.layout.dialo ...
michaelye1988 评论(0) 有9580人浏览 2013-01-27 20:54

Android Dialog—列表项带图标的列表对话框

1、将TextView装载到列表项中去就可以实现带图标的列表项,这里需要借助BaseAdapter适配器来实现,然后通过getView将TextView返回就OK。 设置图片资源到TextView需要用到setCompoundDrawable(left,top,right,bottom)此方法,如下: textView.setCompoundDrawablesWithIntrinsicBound ...
bcf102 评论(0) 有1954人浏览 2012-05-26 13:45

alertDialog设置主题theme的方法

  AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogCustom));       resources中定义   <?xml version="1.0" encoding="utf-8&quo ...
takurachin 评论(1) 有7346人浏览 2012-01-19 08:24

自定义自己的AlertDialog

android提供的弹出框很单调,往往在开发中需要定义自己的AlertDialog来适应开发的需要 android用户帮助里面的方法是这样: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("Are you sure you want to exit?") ...
houshijie3 评论(0) 有1819人浏览 2011-11-24 11:27

创建最简单的Dialog

package com.ipjmc.dialog; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; public clas ...
ipjmc 评论(0) 有1508人浏览 2011-11-19 11:30

Android40_Dialog

Dialog是Android常用的对话框控件。AlertDialog对话框是Dialog的子类,它提供一个图标,一个标题,一个文本和3个按钮。以前用过的DatePickerDialog和TimePickerDialog是Dialog的间接子类。ProgressDialog是AlertDialog类的一个扩展,可以为一个未定义进度的任务显示一个旋转轮形状的进度动画,或者为一个指定进度的任务显示一个进度 ...
Bauble 评论(0) 有2973人浏览 2011-11-14 00:11

自定义AlertDialog样式,根据屏幕大小来显示

先介绍一些关于AlertDialog的基本知识:     一、AlertDialog简介:AlertDialog的构造方法被声明为protected,所以不能直接使用new关键字来创建AlertDialog类的对象实例。要想创建AlertDialog对话框,需要使用Builder类,该类是AlertDialog类中定义的一个内嵌类。因此必须创建AlertDialog.Builder类的对象实例, ...
aichixihongshi 评论(0) 有4611人浏览 2011-10-19 12:43

改变AlertDialog的大小

    1)更改AlertDialog窗口大小的方法: AlertDialog dialog = new AlertDialog.Builder(this).create(); dialog.show(); WindowManager.LayoutParams params = dialog.getWindow().getAttributes(); params.width = 2 ...
南湖小技工 评论(0) 有2142人浏览 2011-09-28 12:56

<转>Android中的对话框AlertDialog使用技巧合集

  文章来自: http://blog.csdn.net/blue6626/article/details/6641105 今天我用自己写的一个Demo 和大家详细介绍一个Android中的对话框的使用技巧。 
南湖小技工 评论(0) 有2154人浏览 2011-09-22 23:54

Android 按钮事件弹出多个对话框

最近发现,在对按钮添加单击事件监听,在监听事件中弹出一个对话框,如果手机反应比较慢的话,会弹出多个,网上搜索了不少帖子,发现没有太合适的。 最终自己用了一个比较笨的办法实现了: OnClickListener infoClick=new OnClickListener(){ public void onClick(View v) { if(!isClick){    isClic ...
stulpnn 评论(0) 有3791人浏览 2011-09-20 13:20

android 中 涉及到context的时候this和this.getApplictionContext的区别

在android中常常会遇到与context有关的内容,特写下这篇blog,浅论一下context : 在语句 AlertDialog.Builder builder = new AlertDialog.Builder(this); 中,要求传递的 参数就是一个context,在这里我们传入的是this,那么这个this究竟指的是什么东东呢? 这里的this指的是Activ ...
liuyun025 评论(1) 有8468人浏览 2011-08-04 13:59

最近博客热门TAG

Java(141747) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54918) .net(54785) Web(54513) 工作(54116) Linux(50906) Oracle(49876) 应用服务器(43288) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37268) 数据结构(36423)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics