当前位置: 编程技术>移动开发
本页文章导读:
▪PopupWindow 点击回到不消失 PopupWindow 点击返回不消失
注册一个PopupWindow 显示出来按返回键居然不消失,很是郁闷,结果查查资料原来是没有设置background
加上一句
PopupWindow.setBackgroundDrawable(new BitmapDrawable());
就Ok了。
.........
▪ title 标题栏字体设立 title 标题栏字体设置
<!-- Sets the text styles -->
<?xml version="1.0" encoding="utf-8"?>
<!-- Sets the text styles -->
<resources>
<style name="CustomWindowTitleText" parent="android:TextAppearance.WindowTitle"&.........
▪ 取得右键菜单位置 获得右键菜单位置
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo)
{
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
int position = info.position;
}
......
[1]PopupWindow 点击回到不消失
来源: 互联网 发布时间: 2014-02-18
PopupWindow 点击返回不消失
具体要看你代码怎么写的了
注册一个PopupWindow 显示出来按返回键居然不消失,很是郁闷,结果查查资料原来是没有设置background
加上一句
PopupWindow.setBackgroundDrawable(new BitmapDrawable());
就Ok了。
1 楼
jeye_ID
2010-10-28
我设了这个,但按返回键的时候是整个Activity消失,退出程序了,知道怎样解决吗
2 楼
bashenmail
2010-10-29
jeye_ID 写道
我设了这个,但按返回键的时候是整个Activity消失,退出程序了,知道怎样解决吗
具体要看你代码怎么写的了
[2] title 标题栏字体设立
来源: 互联网 发布时间: 2014-02-18
title 标题栏字体设置
<!-- Sets the text styles --> <?xml version="1.0" encoding="utf-8"?> <!-- Sets the text styles --> <resources> <style name="CustomWindowTitleText" parent="android:TextAppearance.WindowTitle"> <item name="android:textSize">20dip</item> <item name="android:textColor">#5599FF</item> <item name="android:textStyle">bold|italic</item> </style> <!-- Changes the background color of the title bar --> <style name="CustomWindowTitleBackground"> <item name="android:background">#222222</item> </style> <!-- Set the theme for the window title --> <!-- NOTE: setting android:textAppearence to style defined above --> <style name="CustomWindowTitle" parent="android:WindowTitle"> <item name="android:textAppearance">@style/CustomWindowTitleText</item> <item name="android:shadowDx">0</item> <item name="android:shadowDy">0</item> <item name="android:shadowRadius">5</item> <item name="android:shadowColor">#1155CC</item> </style> <!-- Override properties in the default theme --> <!-- NOTE: you must explicitly the windowTitleSize property, the title bar will not re-size automatically, text will be clipped --> <style name="CustomTheme" parent="android:Theme"> <item name="android:windowTitleSize">40dip</item> <item name="android:windowTitleStyle">@style/CustomWindowTitle</item> <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item> </style> </resources>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/CustomTheme">
[3] 取得右键菜单位置
来源: 互联网 发布时间: 2014-02-18
获得右键菜单位置
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; int position = info.position;
}
最新技术文章: