Android dialog 全屏

Android中让Dialog全屏: 
一、在style中定义样式:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Transparent">
    <item name="android:windowBackground">@color/transparent_background</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item>
  </style>
</resources>  

其中transparent_background为颜色值:#50000000,透明度为50

二、代码中定义Dialog时添加样式:

View myLoginView = LayoutInflater.from(mContext).inflate(R.layout.activity_answer_category, null);
ListView cList = (ListView) myLoginView.findViewById(R.id.cagetoryList);
cList.setAdapter(new Adapter());
alertDialog = new Dialog(mContext, R.style.Transparent);
alertDialog.setContentView(myLoginView);
alertDialog.show();

Android dialog 全屏,布布扣,bubuko.com

时间: 2024-08-11 20:06:23

Android dialog 全屏的相关文章

Android Dialog全屏显示

网上大多数介绍的实现方式就是在styles.xml中添加<item name="android:windowFullscreen">true</item> 这个属性,但是自己按照操作不好使,后来自己尝试去做一下,总结方法如下代码 Dialog dialog = new Dialog(this, R.style.Dialog); dialog.show(); LayoutInflater inflater = LayoutInflater.from(this);

android的Dialog全屏、activity大小的设置详解

引言:一搬的Dialog系统默认是不允许全屏的,下面我们介绍几种Dialog全屏的方式 第一. final Dialog dialog = new Dialog(WenDetailActivity.this, R.style.popupDialog); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.wen_cover_pager); dialog.setCanceledOn

Android中全屏 及 去掉标题栏

Android中全屏 及 去掉标题栏 <去掉标题栏的方法> 第一种:入门的时候经常使用的一种方法 requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏 注意这句一定要写在setContentView()方法的前面,不然会报错的 第二种:在AndroidManifest.xml文件中定义 <application android:icon="@drawable/icon" android:label="@s

Android中全屏或者取消标题栏

先介绍去掉标题栏的方法: 第一种:也一般入门的时候经常使用的一种方法 requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏 注意这句一定要写在setContentView()方法的前面,不然会报错的 第二种:在AndroidManifest.xml文件中定义 <application android:icon="@drawable/icon" android:label="@string/app_name"

Android实现全屏显示的方法

我们都知道在Android中某些功能的实现往往有两种方法:一种是在xml文件中设置相应属性,另一种是用代码实现.同样Android实现全屏显示也可以通过这两种方法实现: 1.在AndroidManifest.xml的配置文件里面的<activity>标签添加属性: android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 2.在Activity的onCreate()方法中的super()和setContentVie

Xamarin Android Activity全屏

以MainActivity 为例,其他Activity是一样的 在 MainActivity 中设置Theme为@android:style/Theme.NoTitleBar.Fullscreen [Activity(Label = "@string/app_name", Theme = "@android:style/Theme.NoTitleBar.Fullscreen", MainLauncher = true)] 并且将 MainActivity 的父类从A

【Android】Dialog从下往上弹起(Dialog全屏,模态显示)

public class MyDialog extends Dialog implements android.view.View.OnClickListener{ private Button cancel; Context context; View localView; private RelativeLayout clearallpan; protected MyDialog(Context context) { super(context); this.context = contex

问题系列:解决Dialog全屏显示以及Dialog显示自动弹出输入法(转)

继承实现一个dialog,并在onCreate里面做处理. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.some_layout); //设置全屏 getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutP

Android TV 全屏无标题

想要全部窗口全屏无标题,修改 res\values\styles.xml 可设置主题和样式 <resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme"