有没有可能在Xamarin.Forms中删除应用程序的标题栏?我正在开发一个Xamarin.Forms Portable项目。我尝试了很多解决方案,但都没有起作用,我甚至无法启动应用程序。
第一次尝试 我尝试将以下内容添加到我的AndroidManifest.xml文件中,但不起作用:
然后我将这个添加到我的AndroidManifest.xml文件中(也没有起作用)
android:theme="@android:style/Theme.NoTitleBar"
第二次尝试 我尝试在 Resources/values 中创建一个 styles.xml,内容如下:
<?xml version="1.0" encoding="utf-8" ?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.Default" parent="@android:style/Theme"></style>
<style name="Theme.NoTitle" parent="@android:style/Theme.NoTitleBar"></style>
<style name="Theme.FullScreen" parent="@android:style/Theme.NoTitleBar.Fullscreen"></style>
</resources>
然后我将这个添加到我的AndroidManifest.xml文件中(也没有起作用)
android:theme="@style/Theme.NoTitle"
第三次尝试我尝试将以下代码添加到MainActivity.cs的OnCreate方法中(但没有成功)。
RequestWindowFeature(WindowFeatures.NoTitle);
有人能帮我吗?