popupwindow

PopupWindow 使用详解(一) 中文API 文档 赠送 ListPopupWindow 中文 API

坚强是说给别人听的谎言 提交于 2019-12-05 02:47:15
笔者数了数枕巾脱落的头发,发现了 Android 开发常用的类似于弹窗的悬浮窗口 大概是 PopupWindow 和 dialog。之前有还算具体的写过关于 dialog 以及自定义 dialog 甚至是 dialogActivity 的相关笔记,即: Android 系统原生dialog使用 、 Android dialog Activity 使用 、 android自定义相对复杂dialog 。突然感觉 PopupWindow 这个说简单不简单,说难不难的知识点也应该详细研究一下。 下面回归正题,请欣赏笔者的表演: 一、创建 PopupWindow 先说一下 Google 爸爸提供的构造方法 public PopupWindow() public PopupWindow(View contentView) public PopupWindow(int width, int height) public PopupWindow(View contentView, int width, int height) public PopupWindow(View contentView, int width, int height, boolean focusable) public PopupWindow(Context context) public PopupWindow

PopupWindow 使用详解(二) Popwindow 制作常见花哨效果

牧云@^-^@ 提交于 2019-12-05 02:47:05
帝都几日降温,终于被撂倒了。but 只要一息尚存就得不断进步!于是,写出 《PopupWindow 使用详解》的第二篇 笔记,先奉上 第一篇链接: 《PopupWindow 使用详解(一) 中文API 文档 赠送 ListPopupWindow 中文 API》 。下面给大家展示一下制作的效果gif。 PopupWindow 效果演示 下面进行一个样式一个样式的肢解哈,对了,所有效果笔者都没有制作载入动画和退出动画。有需要的小伙伴可以通过 这个方法 public void setAnimationStyle(int animationStyle) 进行设置,也是很简单、很常用的。 效果一、图片选取功能(带阴影) 照片选取样图 1、布局设置 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ll_pic" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/shape_pic_select" android:gravity=

jQuery function to open link in new window

南楼画角 提交于 2019-12-05 02:08:58
I'm trying to find a plugin or simple script to open a file in a popup window by clicking on a button. This used to work, but with all the jQuery updates (even with the migration file), this no longer works. I found this, but this opens the popup and also redirects to the file url: $(document).ready(function() { $('.popup').click(function(event) { window.open($(this).attr("href"), "popupWindow", "width=600,height=600,scrollbars=yes"); }); }); Any way to get a simple popup? It needs to have scrollbars, preferably resizable. I've seen lots of posts for modal boxes, but that does not accomplish

Android PopupWindow showAsDropDown() not working properly

◇◆丶佛笑我妖孽 提交于 2019-12-04 23:31:48
I am using PopupWindow with showAsDropDown(anchor). When the anchor is at the top of the screen it works fine, but when at the bottom of the screen nothing shows up. According to the documentation for PopupWindow.showAsDropDown() this should work: http://developer.android.com/reference/android/widget/PopupWindow.html#showAsDropDown%28android.view.View%29 "Display the content view in a popup window anchored to the bottom-left corner of the anchor view. If there is not enough room on screen to show the popup in its entirety, this method tries to find a parent scroll view to scroll. If no parent

Android: How to drag(move) PopupWindow?

早过忘川 提交于 2019-12-04 22:11:09
问题 I want to be able to move PopupWindow on touch dragging. I don't want UI to update on the release of the touch. I want PopupWindow to follow my touch. This is something what I am doing: mView = mLayoutInflater.inflate(R.layout.popup, null); mPopupWindow = new PopupWindow(mView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, false); mPopupWindow.showAtLocation(parentView, Gravity.CENTER, -5, 30); mView.setOnTouchListener(new OnTouchListener() { private int dx = 0; private int dy = 0;

Unable to add window --token null is not valid;

我怕爱的太早我们不能终老 提交于 2019-12-04 18:25:51
今天遇到如下错误bug: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? 最后终于发现是PopupWindow组件的使用问题,如果你直接在Activity创建的方法中初始化,则会有此错误 因此总结: PopupWindow必须在某个事件中显示或者是开启一个新线程去调用,不能直在 oncreate方法中显示一个PopupWindow,否则永远会有以上错误 参考文章: http://cb269267.iteye.com/blog/1787779 http://blog.csdn.net/fulinwsuafcie/article/details/17192683 http://blog.sina.com.cn/s/blog_4b93170a0100q1km.html 来源: oschina 链接: https://my.oschina.net/u/2363385/blog/528964

Zeroclipboard multiple elements

半腔热情 提交于 2019-12-04 13:08:26
I'm having trouble creating multiple Zeroclipboard instantiations in my code, with each instantiation launching a popup window after it is invoked. <a class="xxx" href="popup.url.php" ><span >FRSDE3RD</a> <a class="xxx" href="popup.url2.php" ><span >FRSDE3RD2</a> <a class="xxx" href="popup.url3.php" ><span >FRSDE3RD3</a> $(document).ready(function(){ ZeroClipboard.setMoviePath( 'path/to/swf/ZeroClipboard.swf' ); // setup single ZeroClipboard object for all our elements clip = new ZeroClipboard.Client(); clip.setHandCursor( true ); // assign a common mouseover function for all elements using

FB.login inside FB.getLoginStatus popup window blocked

久未见 提交于 2019-12-04 12:03:57
问题 I'm trying to integrate Facebook login into my website with Facebook Javascript SDK. According to the step by step instructions provided by Facebook Developer document here, here is the test code I wrote: <script> window.fbAsyncInit = function() { FB.init({ appId : '{$MY_APP_ID}', cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse social plugins on this page version : 'v2.1', // use version 2.1 status : true, // check FB login status }); };

PopupView not showing up?

筅森魡賤 提交于 2019-12-04 10:38:14
问题 Here's the XML (just a webview): <?xml version="1.0" encoding="utf-8"?> <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/couponView" android:layout_height="100dp" android:layout_width="100dp" /> and the code: final View cView = getLayoutInflater().inflate(R.layout.couponlayout, null); PopupWindow pw = new PopupWindow(cView); pw.showAtLocation(findViewById(R.id.mainLayout), Gravity.CENTER, 100, 100); pw.update(); This is in a button.onClick() method. When I

autocompletetextview not working inside popup window

江枫思渺然 提交于 2019-12-04 06:26:06
问题 I am new to android and i am trying to integrate auto complete text view inside popup window. But the auto complete action not working inside the popup window. If i placed the auto complete text view outside the popup auto complete works fine. Xml code of popup window: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill