zoukankan      html  css  js  c++  java
  • android Dialog去掉标题栏 和边框

    首先在 values/Style.xml文件中加入以下代码(如果没有该文件就创建一个XML名为Style.xml)

    <!--重写系统弹出Dialog -->
        <style name="myDialogTheme" parent="android:Theme.Dialog">
            <item name="android:windowFrame">@null</item>
            <item name="android:windowIsFloating">true</item>
            <item name="android:windowIsTranslucent">false</item> 
            <item name="android:windowNoTitle">true</item><!--除去title-->
            <item name="android:windowContentOverlay">@null</item> 
            <item name="android:backgroundDimEnabled">false</item>
            <item name="android:windowBackground">@null</item><!--除去背景色-->
        </style> 

    去掉背景色边框也就去掉了,在你的层中设置背景色就可以了  

    第二步在AndroidManifest.xml中在你注册activity中加入android:theme="@style/myDialogTheme" 这个名就是上面的样式名称

    <activity android:name=".LoginDialog" android:theme="@style/myDialogTheme" android:screenOrientation="portrait"/>

    弹出层方法

     Intent intent=new Intent(Detail_Goods.this,LoginDialog.class);
    startActivity(intent);

  • 相关阅读:
    [转载]四大Java EE容器
    [转载]javaEE规范和SSH三大框架到底有什么关系
    javaee包含的服务和组件
    Java类文件最大限制
    oracle给字段添加描述
    apache commons工具包
    redis教程
    git学习
    编程人物
    程序员必须了解的5大编程准则
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/2427754.html
Copyright © 2011-2022 走看看