- 浏览: 592333 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (154)
- java (31)
- Struts (3)
- Hibernate (8)
- Spring (6)
- JS (14)
- DWR (1)
- Oracle (1)
- SQL Server (0)
- JSF (0)
- JPA (0)
- Grails (3)
- Ajax (1)
- Extjs (0)
- jQuery (4)
- MySQL (2)
- 正则表达式 (2)
- 其他 (6)
- 计算机应用 (7)
- Groovy (8)
- Google (1)
- Web (2)
- MongoDB Java Driver (1)
- mongodb (1)
- Linux (3)
- HTML (1)
- Tomcat (3)
- Eclipse (2)
- JSP (1)
- 缓存 (1)
- 动态 (1)
- 问题与解决 (3)
- HY (1)
- Android (35)
- LBS (1)
最新评论
-
u012136165:
list 方法:纠正:[2,5].add(1,9) ...
Groovy的list和map -
bruce.yuan:
误人子弟的文章。已经看到N个人转了这个帖子,这要贻害多少新人啊 ...
理解并解决GBK转UTF-8奇数中文乱码 -
思念-悲伤:
特意登录上来,感谢下!
理解String的compareTo()方法返回值 -
bo_hai:
总结的好,有效。
理解String的compareTo()方法返回值 -
u012678420:
在onCreate方法中获取某个View的宽度和高度
使用PopupWindow来显示一个浮层
点击按钮后弹出浮层
public class PopupWindowDemo extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.popup_window_demo); findViewById(R.id.popup_window_button).setOnClickListener(listener); } OnClickListener listener = new OnClickListener(){ @Override public void onClick(View arg0) { LayoutInflater inflater = PopupWindowDemo.this.getLayoutInflater(); View popupView = inflater.inflate(R.layout.popup_window, null); PopupWindow mPopupWindow = new PopupWindow(popupView, LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); mPopupWindow.showAtLocation(findViewById(R.id.popup_window), Gravity.CENTER, 0, 0); } }; }
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/popup_window" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="PopupWindow使用示例"/> <Button android:id="@+id/popup_window_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="Popup"/> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="10dip"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/popup_window_bg"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="25dip" android:src="@drawable/popup_window_left"/> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="这是一个浮层" android:textSize="20dip" android:textColor="#000000" android:layout_marginLeft="20dip" android:layout_gravity="center"/> </LinearLayout> </LinearLayout>
发表评论
-
深入分析AIDL原理
2011-11-13 16:14 25365在上一篇文章(Service使用方式)中,介绍了Android ... -
Service使用方式
2011-11-13 15:23 6030使用Service的场合: ... -
在onCreate方法中获取某个View的宽度和高度
2011-10-08 14:54 14422有时候需要在onCreate方法中知道某个View组件的宽度和 ... -
不加载图片,仅仅获取图片文件分辨率
2011-10-08 11:09 3931当从SD卡中获取图片时,如果图片太大,加载会出现溢出异常。因此 ... -
图片移动和缩放
2011-09-29 22:15 2108import android.graphics.Matr ... -
定时任务
2011-09-28 00:53 1490定时任务有执行一次和重复执行两种 public cla ... -
几种创建LayoutInflater对象的方法
2011-09-28 00:51 1846LayoutInflater layoutInflate ... -
判断网络类型及是否有网络
2011-09-28 00:49 2746判断当前是否有可用网络 public boolean ... -
设置全屏
2011-09-26 23:40 18931.编程方式 public void setFullS ... -
dip与px单位之间转换
2011-09-25 10:11 1618//转换dip为px public static in ... -
屏幕尺寸(高、宽)
2011-09-25 10:11 1869Display display = getWindowM ... -
判断手机外存(SD卡)状态
2011-09-25 10:07 2142public int getExternalStorag ... -
SQLite数据类型
2011-09-25 10:03 9325一般数据采用的固 ... -
使用WebView实现腾讯微博OAuth登录
2011-09-24 21:11 4855接着上一篇文章"使用WebView实现新浪微博OAu ... -
使用WebView实现新浪微博OAuth登录
2011-09-20 12:18 8474#新浪官方下载SDK(weibo4android) h ... -
高效率下载图片——防止内存溢出
2011-09-18 13:09 2185在应用中经常需要下载很多的图片,因此,写好图片下载部分的代码非 ... -
Android通知
2011-09-07 17:56 1895private void showNotification() ... -
AlarmManager.RTC和ELAPSED_REALTIME的区别
2011-09-04 17:33 30036AlarmManager.RTC,硬件闹钟,不唤醒手机( ... -
开机自启动
2011-09-04 13:55 1622经常会有这样的需求,当手机开机后立刻启动一个服务或者一个活动。 ... -
Android虚拟机(DVM)内存分配——内存溢出问题
2011-09-03 17:19 9879大家都知道Android的上层应用是基于 Dalvik ...
相关推荐
博客《 PopUpWindow使用详解(一)——基本使用》对应源码,博客地址:http://blog.csdn.net/harvic880925/article/details/49272285
android中popupWindow使用案列。点击按钮,显示出菜单按钮。
Android PopupWindow使用示例,更多信息请访问http://blog.csdn.net/qingdujun/article/details/42609549
博客《PopUpWindow使用详解(二)——进阶及答疑》对应源码,博客地址:http://blog.csdn.net/harvic880925/article/details/49278705
popupWindow使用的方法,以及PopupWindow样式的使用
PopupWindow 使用实例
这个demo主要介绍了,popupwindow的基本使用,实现了popupwindow和listView的结合希望可以帮助需要的同学
PopupWindow的简单使用!
主要为大家详细介绍了Android中PopupWindow使用方法,感兴趣的小伙伴们可以参考一下
PopupWindow精确计算要显示位置原理和方法;实现带箭头的上下文菜单遇到的坑;Android7.0 PopupWindow的兼容… 方案是为解决特定问题或达成特定目标而制定的一系列计划或步骤。它的作用是提供一种系统性的方法,以...
NULL 博文链接:https://hz-chenwenbiao-91.iteye.com/blog/2086352
popupwindow的简单使用,对提示框的显示位置做了详细描述,和用popupwindow做简单的下拉列表。
主要介绍了Android PopupWindow使用实例,本文直接给出代码实例,需要的朋友可以参考下
主要为大家详细介绍了Android组件popupwindow使用方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
popupwindow使用以及渐变背景
使用PopupWindow很简单,可以总结为三个步骤: 创建PopupWindow对象实例; 设置背景、注册事件监听器和添加动画; 显示PopupWindow。 其中,第二步是可选的(不过基本上都要进行第二步的设置)。下面是一个简单的...
使用popupWindow实现类似微信点击右上角加号弹出添加好友的列表,还有在底部弹出的popupWindow
(1)Popupwindow在显示之前一定要设置宽高,Dialog无此限制。 (2)Popupwindow默认不会响应物理键盘的back,除非显示设置了popup.setFocusable(true);而在点击back的时候,Dialog会消失。 (3)Popupwindow不会...
该项目演示了,PopupWindow的基本使用,相关PopupWindow代码有独立的Class文件,并且有大量的注释说明。实现的功能有弹出的PopupWindow上有EditText能与软键盘并存不冲突,弹出PopupWindow的时候背景自动改变灰度为...