怎么实现让PopupWindow默认为弹出形式???
解决方案 »
- Android 4.0真机系统无法连接Tomcat服务器
- findViewbyid()出现空指针
- 发布app到google play支付失败
- Re-installation failed due to different application signatures.
- 自定义view不显示,跪求答案
- [求助]是否能在Cygwin下编译Android源码?
- 使用HTML5+JQuery Mobile+PhoneGap+Service开发移动应用"钱"途怎么样?
- Android的声波通信实例中如何传输11个0~9的数字以及代码详解
- android fragment
- Mac系统AndroidStudio ADM 打不开出现错误日志
- activity不能正常显示的问题
- 用程序直接连接和断掉网络,是否可行
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflate = LayoutInflater.from(this);
setContentView(R.layout.main);
mWindow = new PopupWindow(this);
mWindow.setWidth(WindowManager.LayoutParams.FILL_PARENT);
mWindow.setHeight(WindowManager.LayoutParams.FILL_PARENT);
View parent = inflate.inflate(R.layout.main, null);
mWindow.getMaxAvailableHeight(parent); mWindow.setTouchable(true);
mWindow.setFocusable(true);
inflate = LayoutInflater.from(this);
mRoot = inflate.inflate(R.layout.popup_window, null);
mWindow.setContentView(mRoot);
mWindow.setAnimationStyle(R.style.Animations_PopDownMenu);
} public void onImageClick(View v){
mWindow.showAtLocation(getWindow().getDecorView(), Gravity.NO_GRAVITY, 0, 0);
}