In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to set the value of the preference Preferences in XamarinEssentials. It is very detailed and has a certain reference value. Friends who are interested must read it!
If you want to set the value of one of the preferences, you can do so through the Set () method of the Preferences class, which sets the value of the specified key. There are 12 forms of this method, which are introduced in turn below.
(1) the syntax of the Set (string, bool) method is as follows:
Public static void Set (string key, bool value)
(2) the syntax of the Set (string, bool, string) method is as follows:
Public static void Set (string key, bool value, string sharedName)
(3) the syntax of the Set (string, double) method is as follows:
Public static void Set (string key, double value)
(4) the syntax of the Set (string, double, string) method is as follows:
Public static void Set (string key, double value, string sharedName)
(5) the syntax of the Set (string, float) method is as follows:
Public static void Set (string key, float value)
(6) the syntax of the Set (string, float, string) method is as follows:
Public static void Set (string key, float value, string sharedName)
(7) the syntax of the Set (string, int) method is as follows:
Public static void Set (string key, int value)
(8) the syntax of the Set (string, int, string) method is as follows:
Public static void Set (string key, int value, string sharedName)
(9) the syntax of the Set (string, long) method is as follows:
Public static void Set (string key, long value)
(10) the syntax of the Set (string, long, string) method is as follows:
Public static void Set (string key, long value, string sharedName)
(11) the syntax of the Set (string, string) method is as follows:
Public static void Set (string key, string value)
(12) the syntax of the Set (string, string, string) method is as follows:
Public static void Set (string key, string value, string sharedName)
The parameters are described as follows:
Key: keys for preferences
Value: the value of the preference.
SharedName: shared container name.
Note: the following six data types are supported in Preferences:
Bool: Boolean type.
Double: double precision type.
Int: integer.
Float: single precision type.
Long: long integer.
String: string.
[example 1-5] the value of the specified key will be set below. The code is as follows:
Void Preferences_Set (string key, string value)
{
Preferences.Set (key, value) / / sets the value of the specified key
}
The above is all the content of the article "how to set the value of preference Preferences in XamarinEssentials". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.