Xamarin 中开发Android实现全屏或者不显示标题栏的方法-宋兴柱
Xamarin 中开发Android实现全屏或者不显示标题栏的方法-宋兴柱
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace AndroidDemo
{
[Activity(Label = "Android", MainLauncher = true, Icon = "@drawable/AppIcon")]//Theme = "@android:style/Theme.NoTitleBar.Fullscreen"
public class MainActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
this.SetTheme(Android.Resource.Style.ThemeNoTitleBarFullScreen);//全屏并且无标题栏,必须在OnCreate前面设置。
//this.Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);//只设置本页全屏
//this.RequestWindowFeature(WindowFeatures.NoTitle);//只设置无标题栏
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
FindViewById<Button>(Resource.Id.button1).Click += (ss, ee) => { this.StartActivity(typeof(Views.GalleryDemo.GallleryActivity)); };
FindViewById<Button>(Resource.Id.button2).Click += (ss, ee) =>
{
this.StartActivity(typeof(Views.ImageButtonActivity));
//this.OverridePendingTransition(Resource.Animation.enterfrombottom_anim, Resource.Animation.outtobottom_anim);
this.OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
};
}
}
}
Xamarin 中开发Android实现全屏或者不显示标题栏的方法-宋兴柱
https://www.dearcloud.cn/2015/03/21/20200310-cnblogs-old-posts/20150321-Xamarin中开发Android实现全屏或者不显示标题栏的方法-宋兴柱/