将activity设置成theme.Dailog之后,如何设置这个activity显示的大小,位置等属性 看到uc浏览器的主界面上,点击菜单选项之后,在这个上方弹出一个对话框,不知道是用什么实现的?这个有知道的大虾可以说一下,我就用一个activity设置成theme.Dailog实现,但是看里面的属性,找了很久,没有发现哪个是设置这些属性的,有知道的大虾麻烦讲解一下。。谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 自定义style,然后应用自定义的style到Activityandroid:theme="@style/你自定义的style" xml文件<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" ></RelativeLayout>style文件<?xml version="1.0" encoding="utf-8"?><resources> <style name="theme.common.dialog" parent="android:style/Theme.Dialog"> <item name="android:windowNoTitle">true</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item> <item name="android:windowBackground">@drawable/transparent_background</item> </style></resources>manifest文件<activity android:name=".YourAct" android:screenOrientation="portrait" android:theme="@style/theme.common.dialog" > </activity>自己调一下 我没有用自己的sytle,用的是系统的<style name="Theme.Dialog">,这个里面的属性我看了,不知道哪个是设置这个activity大小,位置的属性。 嗯,你这个自己写的sytle里面,没有设置大小,位置的属性吧? 创建res/values/styles.xml内容:<?xml version="1.0" encoding="utf-8"?> <resources> <!-- 自定义一个theme继承自android:style/Theme.Dialog--> <style name="Theme.myTheme" parent="android:style/Theme.Dialog"> <!--改变高,其它就能自己弄了吧??--> <item name="android:height">10dip</item> </style> </resources>然后在Activity的配置文件里:android:theme="@style/Theme.myTheme" 其实楼主的这个要求不应该这样子来实现的,应该用PopupWindow来实现,这也是一个浮动窗口,看过其它资料,差不多都是用PopupWindow来实现的 嗯,谢谢你的分享,PopupWindow实现的方法,我再到网上看看具体怎么实现的。用上面那个方法是已经实现了达到了透明显示的效果 求解啊:ListView选中项改变背景颜色后,下滚的那个也被改变了 intent 转换Activity问题 android serialport-api 数据丢失 求助,真不行了,瓦片地图,这个要怎么弄才对? android LogCat输出中文乱码 android三级列表显示不完整的问题 移动图片 android导航开发 新手求解 android GridLayout里面控件过多,超过一屏,怎么滚动? andriod开发求助!! 安卓创建联系人失败
android:theme="@style/你自定义的style"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
style文件
<?xml version="1.0" encoding="utf-8"?>
<resources> <style name="theme.common.dialog" parent="android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
<item name="android:windowBackground">@drawable/transparent_background</item>
</style></resources>manifest文件
<activity
android:name=".YourAct"
android:screenOrientation="portrait"
android:theme="@style/theme.common.dialog"
>
</activity>
自己调一下
<resources>
<!-- 自定义一个theme继承自android:style/Theme.Dialog-->
<style name="Theme.myTheme" parent="android:style/Theme.Dialog">
<!--改变高,其它就能自己弄了吧??-->
<item name="android:height">10dip</item>
</style>
</resources>
然后在Activity的配置文件里:
android:theme="@style/Theme.myTheme"