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);
};
} }
}
上一篇:MyBatis学习(二)、SQL语句映射文件(1)resultMap


下一篇:Centos7 Minimal 安装后 初始化配置