且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Xamarin.Forms 应用程序的 android 部分禁用 defaultFocusHighlightEnabled

更新时间:2023-02-26 20:56:57

我能够通过评论解决问题

I was able to solve the issue with the comments

在我的styles.xml 文件(在主要活动中引用)中,我在主题中添加了条目

In my styles.xml file (referenced in the main activity) I added the entry in the theme

MainActivity.cs

[Activity(Label = "Sage Service Ops", Icon = "@drawable/icon", MainLauncher = false, Theme = "@style/MyTheme", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity

styles.xml

<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
  <item name="android:actionBarStyle">@style/MyTheme.ActionBarStyle</item>
  <item name="android:defaultFocusHighlightEnabled">false</item>
</style>