2024-07-19 Unity插件 Odin Inspector10 —— Misc Attributes

news2024/11/13 15:11:08

文章目录

  • 1 说明
  • 2 其他特性
    • 2.1 CustomContextMenu
    • 2.2 DisableContextMenu
    • 2.3 DrawWithUnity
    • 2.4 HideDuplicateReferenceBox
    • 2.5 Indent
    • 2.6 InfoBox
    • 2.7 InlineProperty
    • 2.8 LabelText
    • 2.9 LabelWidth
    • 2.10 OnCollectionChanged
    • 2.11 OnInspectorDispose
    • 2.12 OnInspectorGUI
    • 2.13 OnInspectorInit
    • 2.14 OnStateUpdate
    • 2.15 OnValueChanged
    • 2.16 TypeSelectorSettings
    • 2.17 TypeRegistryItem
    • 2.18 PropertyTooltip
    • 2.19 SuffixLabel

1 说明

​ 本文介绍 Odin Inspector 插件中其他特性的使用方法。

2 其他特性

2.1 CustomContextMenu

为对象的上下文菜单(右键该对象展开)添加自定义选项,当前不支持静态方法。

  • string menuItem

    菜单栏(“/ ”分隔子菜单)。

  • string action

    单击上下文菜单时要采取的操作方法名。

image-20240719134925070
// CustomContextMenuExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class CustomContextMenuExamplesComponent : MonoBehaviour
{
    [InfoBox("A custom context menu is added on this property. Right click the property to view the custom context menu.")]
    [CustomContextMenu("Say Hello/Twice", "SayHello")]
    public int MyProperty;

    private void SayHello() {
        Debug.Log("Hello Twice");
    }
}

2.2 DisableContextMenu

禁用 Odin 提供的所有右键单击上下文菜单,不会禁用 Unity 的上下文菜单。

  • bool disableForMember = true

    是否禁用成员本身的上下文菜单。

  • bool disableCollectionElements = false

    是否同时禁用集合元素的上下文菜单。

image-20240719174820302
// DisableContextMenuExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class DisableContextMenuExamplesComponent : MonoBehaviour
{
    [InfoBox("DisableContextMenu disables all right-click context menus provided by Odin. It does not disable Unity's context menu.", InfoMessageType.Warning)]
    [DisableContextMenu]
    public int[] NoRightClickList = new int[] { 2, 3, 5 };

    [DisableContextMenu(disableForMember: false, disableCollectionElements: true)]
    public int[] NoRightClickListOnListElements = new int[] { 7, 11 };

    [DisableContextMenu(disableForMember: true, disableCollectionElements: true)]
    public int[] DisableRightClickCompletely = new int[] { 13, 17 };

    [DisableContextMenu]
    public int NoRightClickField = 19;
}

2.3 DrawWithUnity

禁用特定成员的 Odin 绘图,而使用 Unity 的旧绘图系统进行绘制。
注意:

  1. 此特性并不意味着“完全禁用对象的 Odin”;本质上只是调用 Unity 的旧属性绘图系统,Odin 仍然最终负责安排对象的绘制。
  2. 其他特性的优先级高于此特性。
  3. 如果存在另一个特性来覆盖此特性,则不能保证会调用 Unity 绘制属性。
image-20240719175016445
// DrawWithUnityExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class DrawWithUnityExamplesComponent : MonoBehaviour
{
    [InfoBox("If you ever experience trouble with one of Odin's attributes, there is a good chance that DrawWithUnity will come in handy; it will make Odin draw the value as Unity normally would.")]
    public GameObject ObjectDrawnWithOdin;

    [DrawWithUnity]
    public GameObject ObjectDrawnWithUnity;
}

2.4 HideDuplicateReferenceBox

如果由于遇到重复的引用值,而使此属性以其他方式绘制为对另一个属性的引用,则 Odin 将隐藏引用框。

注意:如果该值递归引用自身,则无论在所有递归绘制调用中是否使用此属性,都会绘制引用框。

image-20240719175723882
// HideDuplicateReferenceBoxExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

#if UNITY_EDITOR // Editor namespaces can only be used in the editor.
using Sirenix.Utilities.Editor;
#endif

public class HideDuplicateReferenceBoxExamplesComponent : SerializedMonoBehaviour
{
    [PropertyOrder(1)]
    public ReferenceTypeClass firstObject;

    [PropertyOrder(3)]
    public ReferenceTypeClass withReferenceBox;

    [PropertyOrder(5)]
    [HideDuplicateReferenceBox]
    public ReferenceTypeClass withoutReferenceBox;

    [OnInspectorInit]
    public void CreateData() {
        this.firstObject                    = new ReferenceTypeClass();
        this.withReferenceBox               = this.firstObject;
        this.withoutReferenceBox            = this.firstObject;
        this.firstObject.recursiveReference = this.firstObject;
    }

    public class ReferenceTypeClass
    {
        [HideDuplicateReferenceBox]
        public ReferenceTypeClass recursiveReference;

#if UNITY_EDITOR // Editor-related code must be excluded from builds
        [OnInspectorGUI, PropertyOrder(-1)]
        private void MessageBox() {
            SirenixEditorGUI.WarningMessageBox("Recursively drawn references will always show the reference box regardless, to prevent infinite depth draw loops.");
        }
#endif
    }

#if UNITY_EDITOR // Editor-related code must be excluded from builds
    [OnInspectorGUI, PropertyOrder(0)]
    private void MessageBox1() {
        SirenixEditorGUI.Title("The first reference will always be drawn normally", null, TextAlignment.Left, true);
    }

    [OnInspectorGUI, PropertyOrder(2)]
    private void MessageBox2() {
        GUILayout.Space(20);
        SirenixEditorGUI.Title("All subsequent references will be wrapped in a reference box", null, TextAlignment.Left, true);
    }

    [OnInspectorGUI, PropertyOrder(4)]
    private void MessageBox3() {
        GUILayout.Space(20);
        SirenixEditorGUI.Title("With the [HideDuplicateReferenceBox] attribute, this box is hidden", null, TextAlignment.Left, true);
    }
#endif
}

2.5 Indent

将对象标签向右缩进。

  • int indentLevel = 1

    缩进大小。

image-20240719180122436
// IndentExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class IndentExamplesComponent : MonoBehaviour
{
    [Title("Nicely organize your properties.")]
    [Indent]
    public int A;

    [Indent(2)]
    public int B;

    [Indent(3)]
    public int C;

    [Indent(4)]
    public int D;

    [Title("Using the Indent attribute")]
    [Indent]
    public int E;

    [Indent(0)]
    public int F;

    [Indent(-1)]
    public int G;
}

2.6 InfoBox

在对象上方显示文本框以注释或警告。

  • string message

    消息内容。

  • SdfIconType icon

    图标。

  • string visibleIfMemberName = null

    用于显示或隐藏消息框的 bool 成员名称。

  • InfoMessageType infoMessageType = InfoMessageType.Info

    消息类型。

image-20240719180445061
// InfoBoxExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class InfoBoxExamplesComponent : MonoBehaviour
{
    [Title("InfoBox message types")]
    [InfoBox("Default info box.")]
    public int A;

    [InfoBox("Warning info box.", InfoMessageType.Warning)]
    public int B;

    [InfoBox("Error info box.", InfoMessageType.Error)]
    public int C;

    [InfoBox("Info box without an icon.", InfoMessageType.None)]
    public int D;

    [Title("Conditional info boxes")]
    public bool ToggleInfoBoxes;

    [InfoBox("This info box is only shown while in editor mode.", InfoMessageType.Error, "IsInEditMode")]
    public float G;

    [InfoBox("This info box is hideable by a static field.", "ToggleInfoBoxes")]
    public float E;

    [InfoBox("This info box is hideable by a static field.", "ToggleInfoBoxes")]
    public float F;

    [Title("Info box member reference and attribute expressions")]
    [InfoBox("$InfoBoxMessage")]
    [InfoBox("@\"Time: \" + DateTime.Now.ToString(\"HH:mm:ss\")")]
    public string InfoBoxMessage = "My dynamic info box message";

    private static bool IsInEditMode() {
        return !Application.isPlaying;
    }
}

2.7 InlineProperty

将类型的内容显示在标签旁,而不是以折叠方式呈现。

  • int LabelWidth

    为所有子属性指定标签宽度。

image-20240719180831062
// InlinePropertyExamplesComponent.cs

using Sirenix.OdinInspector;
using System;
using UnityEngine;

public class InlinePropertyExamplesComponent : MonoBehaviour
{
    public Vector3 Vector3;

    public Vector3Int MyVector3Int;

    [InlineProperty(LabelWidth = 13)]
    public Vector2Int MyVector2Int;

    [Serializable]
    [InlineProperty(LabelWidth = 13)]
    public struct Vector3Int
    {
        [HorizontalGroup]
        public int X;

        [HorizontalGroup]
        public int Y;

        [HorizontalGroup]
        public int Z;
    }

    [Serializable]
    public struct Vector2Int
    {
        [HorizontalGroup]
        public int X;

        [HorizontalGroup]
        public int Y;
    }
}

2.8 LabelText

更改对象在 Inspector 窗口中显示的标签内容。

  • string text

    标签内容。

  • SdfIconType icon

    图标。

image-20240719181116242
// LabelTextExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class LabelTextExamplesComponent : MonoBehaviour
{
    [LabelText("1")]
    public int MyInt1 = 1;

    [LabelText("2")]
    public int MyInt2 = 12;

    [LabelText("3")]
    public int MyInt3 = 123;

    [InfoBox("Use $ to refer to a member string.")]
    [LabelText("$MyInt3")]
    public string LabelText = "The label is taken from the number 3 above";

    [InfoBox("Use @ to execute an expression.")]
    [LabelText("@DateTime.Now.ToString(\"HH:mm:ss\")")]
    public string DateTimeLabel;

    [LabelText("Test", SdfIconType.HeartFill)]
    public int LabelIcon1 = 123;

    [LabelText("", SdfIconType.HeartFill)]
    public int LabelIcon2 = 123;
}

2.9 LabelWidth

指定标签绘制的宽度。

  • float width

    宽度。

image-20240719181513829
// LabelWidthExampleComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class LabelWidthExampleComponent : MonoBehaviour
{
    public int DefaultWidth;

    [LabelWidth(50)]
    public int Thin;

    [LabelWidth(250)]
    public int Wide;
}

2.10 OnCollectionChanged

通过 Inspector 窗口更改集合时,触发指定事件回调。

适用于具有集合解析器的集合,包括数组、列表、字典、哈希集、堆栈和链表。

注意:此特性仅在编辑器中有效!由脚本更改的集合不会触发回调事件!

  • string before/after

    更改前 / 后触发的事件回调。

image-20240719181829143
// OnCollectionChangedExamplesComponent.cs

using Sirenix.OdinInspector;
using System.Collections.Generic;
using UnityEngine;

#if UNITY_EDITOR // Editor namespaces can only be used in the editor.
using Sirenix.OdinInspector.Editor;
#endif

public class OnCollectionChangedExamplesComponent : SerializedMonoBehaviour
{
    [InfoBox("Change the collection to get callbacks detailing the changes that are being made.")]
    [OnCollectionChanged("Before", "After")]
    public List<string> list = new List<string>() { "str1", "str2", "str3" };

    [OnCollectionChanged("Before", "After")]
    public HashSet<string> hashset = new HashSet<string>() { "str1", "str2", "str3" };

    [OnCollectionChanged("Before", "After")]
    public Dictionary<string, string> dictionary = new Dictionary<string, string>() { { "key1", "str1" }, { "key2", "str2" }, { "key3", "str3" } };

#if UNITY_EDITOR // Editor-related code must be excluded from builds
    public void Before(CollectionChangeInfo info, object value) {
        Debug.Log("Received callback BEFORE CHANGE with the following info: " + info + ", and the following collection instance: " + value);
    }

    public void After(CollectionChangeInfo info, object value) {
        Debug.Log("Received callback AFTER CHANGE with the following info: " + info + ", and the following collection instance: " + value);
    }
#endif
}

2.11 OnInspectorDispose

对象在 Inspector 窗口中被释放时(更改对象或 Inspector 窗口被隐藏 / 关闭)执行回调。

  • string action

    要调用的方法名称,或要执行的表达式。

image-20240719183127075
// OnInspectorDisposeExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class OnInspectorDisposeExamplesComponent : MonoBehaviour
{
    [OnInspectorDispose("@UnityEngine.Debug.Log(\"Dispose event invoked!\")")]
    [ShowInInspector, InfoBox("When you change the type of this field, or set it to null, the former property setup is disposed. The property setup will also be disposed when you deselect this example."), DisplayAsString]
    public BaseClass PolymorphicField;
    
    public abstract class BaseClass { public override string ToString() { return this.GetType().Name; } }
    public class A : BaseClass { }
    public class B : BaseClass { }
    public class C : BaseClass { }
}

2.12 OnInspectorGUI

在 Inpsector 代码运行时调用指定方法。使用此选项为对象添加自定义 Inspector GUI。

  • string action

    添加的绘制方法。

image-20240719183246119
// OnInspectorGUIExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class OnInspectorGUIExamplesComponent : MonoBehaviour
{
    [OnInspectorInit("@Texture = Sirenix.Utilities.Editor.EditorIcons.OdinInspectorLogo")]
    [OnInspectorGUI("DrawPreview", append: true)]
    public Texture2D Texture;

    private void DrawPreview() {
        if (this.Texture == null) return;

        GUILayout.BeginVertical(GUI.skin.box);
        GUILayout.Label(this.Texture);
        GUILayout.EndVertical();
    }

#if UNITY_EDITOR // Editor-related code must be excluded from builds
    [OnInspectorGUI]
    private void OnInspectorGUI() {
        UnityEditor.EditorGUILayout.HelpBox("OnInspectorGUI can also be used on both methods and properties", UnityEditor.MessageType.Info);
    }
#endif
}

2.13 OnInspectorInit

对象在 Inspector 窗口中被初始化时(打开 / 显示 Inspector 窗口)执行回调。

  • string action

    要调用的方法名称,或要执行的表达式。

image-20240719183806323
// OnInspectorInitExamplesComponent.cs

using Sirenix.OdinInspector;
using System;
using UnityEngine;

#if UNITY_EDITOR // Editor namespaces can only be used in the editor.
using Sirenix.Utilities.Editor;
#endif

public class OnInspectorInitExamplesComponent : MonoBehaviour
{
    // Display current time for reference.
    [ShowInInspector, DisplayAsString, PropertyOrder(-1)]
    public string CurrentTime {
        get {
#if UNITY_EDITOR // Editor-related code must be excluded from builds
            GUIHelper.RequestRepaint();
#endif
            return DateTime.Now.ToString();
        }
    }

    // OnInspectorInit executes the first time this string is about to be drawn in the inspector.
    // It will execute again when the example is reselected.
    [OnInspectorInit("@TimeWhenExampleWasOpened = DateTime.Now.ToString()")]
    public string TimeWhenExampleWasOpened;

    // OnInspectorInit will not execute before the property is actually "resolved" in the inspector.
    // Remember, Odin's property system is lazily evaluated, and so a property does not actually exist
    // and is not initialized before something is actually asking for it.
    // 
    // Therefore, this OnInspectorInit attribute won't execute until the foldout is expanded.
    [FoldoutGroup("Delayed Initialization", Expanded = false, HideWhenChildrenAreInvisible = false)]
    [OnInspectorInit("@TimeFoldoutWasOpened = DateTime.Now.ToString()")]
    public string TimeFoldoutWasOpened;
}

2.14 OnStateUpdate

在 Inspector 窗口中每帧监听对象的状态。

通常每帧至少发生一次监听,即使对象不可见时也会。

  • string action

    监听执行的方法。

image-20240719213837378
// AnotherPropertysStateExampleComponent.cs

using Sirenix.OdinInspector;
using System.Collections.Generic;
using UnityEngine;

public class AnotherPropertysStateExampleComponent : MonoBehaviour
{
    public List<string> list;

    [OnStateUpdate("@#(list).State.Expanded = $value")]
    public bool ExpandList;
}

2.15 OnValueChanged

适用于属性和字段,每当通过 Inspector 窗口更改对象时,都会调用指定的函数。

注意:此特性仅在编辑器中有效!通过脚本更改的属性不会调用该函数。

image-20240719215847452
// OnValueChangedExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class OnValueChangedExamplesComponent : MonoBehaviour
{
    [OnValueChanged("CreateMaterial")]
    public Shader Shader;

    [ReadOnly, InlineEditor(InlineEditorModes.LargePreview)]
    public Material Material;

    private void CreateMaterial() {
        if (this.Material != null) {
            Material.DestroyImmediate(this.Material);
        }

        if (this.Shader != null) {
            this.Material = new Material(this.Shader);
        }
    }
}

2.16 TypeSelectorSettings

提供 Type 类型的绘制选择器。

  • bool ShowCategories

    下拉选择 Type 时是否分类显示可选项。

  • bool PreferNamespaces

    是否依据命名空间显示分类。默认依据程序集名称分类。

  • bool ShowNoneItem

    是否显示 “None”。

  • string FilterTypesFunction

    用于过滤类型选择器中显示的类型的函数。

image-20240719221035793
// TypeSelectorSettingsExampleComponent.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Sirenix.OdinInspector;
using UnityEngine;

public class TypeSelectorSettingsExampleComponent : MonoBehaviour
{
    [ShowInInspector]
    public Type Default;

    [Title("Show Categories"), ShowInInspector, LabelText("On")]
    [TypeSelectorSettings(ShowCategories = true)]
    public Type ShowCategories_On;

    [ShowInInspector, LabelText("Off")]
    [TypeSelectorSettings(ShowCategories = false)]
    public Type ShowCategories_Off;

    [Title("Prefer Namespaces"), ShowInInspector, LabelText("On")]
    [TypeSelectorSettings(PreferNamespaces = true, ShowCategories = true)]
    public Type PreferNamespaces_On;

    [ShowInInspector, LabelText("Off")]
    [TypeSelectorSettings(PreferNamespaces = false, ShowCategories = true)]
    public Type PreferNamespaces_Off;

    [Title("Show None Item"), ShowInInspector, LabelText("On")]
    [TypeSelectorSettings(ShowNoneItem = true)]
    public Type ShowNoneItem_On;

    [ShowInInspector, LabelText("Off")]
    [TypeSelectorSettings(ShowNoneItem = false)]
    public Type ShowNoneItem_Off;

    [Title("Custom Type Filter"), ShowInInspector]
    [TypeSelectorSettings(FilterTypesFunction = nameof(TypeFilter), ShowCategories = false)]
    public Type CustomTypeFilterExample;

    private bool TypeFilter(Type type) {
        return type.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable<>));
    }
}

2.17 TypeRegistryItem

为类型注册 Inspector 窗口的显示器。

  • string Name = null

    显示名称。

  • string CategoryPath = null

    分类路径。

  • SdfIconType Icon = SdfIconType.None

    左侧图标。

  • float lightIconColorR/G/B/A = 0.0f

    在浅色模式下图标颜色的 RGBA 分量。

  • float darkIconColorR/G/B/A = 0.0f

    在深色模式下图标颜色的 RGBA 分量。

  • int Priority = 0

    显示优先级。

image-20240719221334683
// TypeRegistryItemSettingsExampleComponent.cs

using System;
using Sirenix.OdinInspector;
using UnityEngine;

public class TypeRegistryItemSettingsExampleComponent : MonoBehaviour
{
    private const string CATEGORY_PATH  = "Sirenix.TypeSelector.Demo";
    private const string BASE_ITEM_NAME = "Painting Tools";
    private const string PATH           = CATEGORY_PATH + "/" + BASE_ITEM_NAME;

    [TypeRegistryItem(Name = BASE_ITEM_NAME, Icon = SdfIconType.Tools, CategoryPath = CATEGORY_PATH, Priority = Int32.MinValue)]
    public abstract class Base
    { }

    [TypeRegistryItem(darkIconColorR: 0.8f, darkIconColorG: 0.3f,
                      lightIconColorR: 0.3f, lightIconColorG: 0.1f,
                      Name = "Brush", CategoryPath = PATH, Icon = SdfIconType.BrushFill, Priority = Int32.MinValue)]
    public class InheritorA : Base
    {
        public Color Color          = Color.red;
        public float PaintRemaining = 0.4f;
    }

    [TypeRegistryItem(darkIconColorG: 0.8f, darkIconColorB: 0.3f,
                      lightIconColorG: 0.3f, lightIconColorB: 0.1f,
                      Name = "Paint Bucket", CategoryPath = PATH, Icon = SdfIconType.PaintBucket, Priority = Int32.MinValue)]
    public class InheritorB : Base
    {
        public Color Color          = Color.green;
        public float PaintRemaining = 0.8f;
    }

    [TypeRegistryItem(darkIconColorB: 0.8f, darkIconColorG: 0.3f,
                      lightIconColorB: 0.3f, lightIconColorG: 0.1f,
                      Name = "Palette", CategoryPath = PATH, Icon = SdfIconType.PaletteFill, Priority = Int32.MinValue)]
    public class InheritorC : Base
    {
        public ColorPaletteItem[] Colors = {
            new ColorPaletteItem(Color.blue, 0.8f),
            new ColorPaletteItem(Color.red, 0.5f),
            new ColorPaletteItem(Color.green, 1.0f),
            new ColorPaletteItem(Color.white, 0.6f),
        };
    }

    [ShowInInspector]
    [PolymorphicDrawerSettings(ShowBaseType = false)]
    [InlineProperty]
    public Base PaintingItem;

    public struct ColorPaletteItem
    {
        public Color Color;
        public float Remaining;

        public ColorPaletteItem(Color color, float remaining) {
            this.Color     = color;
            this.Remaining = remaining;
        }
    }
}

2.18 PropertyTooltip

在 Inspector 窗口中鼠标悬停在对象上时创建工具提示。

注意:类似于 Unity 的 TooltipAttribute,但可以应用于属性。

  • string tooltip

    悬停提示。

image-20240719222622476
// PropertyTooltipExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class PropertyTooltipExamplesComponent : MonoBehaviour
{
    [PropertyTooltip("This is tooltip on an int property.")]
    public int MyInt;

    [InfoBox("Use $ to refer to a member string.")]
    [PropertyTooltip("$Tooltip")]
    public string Tooltip = "Dynamic tooltip.";

    [Button, PropertyTooltip("Button Tooltip")]
    private void ButtonWithTooltip() {
        // ...
    }
}

2.19 SuffixLabel

在对象末尾绘制后缀标签,用于传达对象的数值含义。

  • string label

    后缀标签名。

  • SdfIconType icon

    图标。

  • bool overlay = false

    后缀标签将绘制在对象值的内部,而不是外面。

  • string IconColor

    图标颜色。

image-20240719223010091
// SuffixLabelExamplesComponent.cs

using Sirenix.OdinInspector;
using UnityEngine;

public class SuffixLabelExamplesComponent : MonoBehaviour
{
    [SuffixLabel("Prefab")]
    public GameObject GameObject;

    [Space(15)]
    [InfoBox("Using the Overlay property, the suffix label will be drawn on top of the property instead of behind it.\n" +
             "Use this for a neat inline look.")]
    [SuffixLabel("ms", Overlay = true)]
    public float Speed;

    [SuffixLabel("radians", Overlay = true)]
    public float Angle;

    [Space(15)]
    [InfoBox("The Suffix attribute also supports referencing a member string field, property, or method by using $.")]
    [SuffixLabel("$Suffix", Overlay = true)]
    public string Suffix = "Dynamic suffix label";

    [InfoBox("The Suffix attribute also supports expressions by using @.")]
    [SuffixLabel("@DateTime.Now.ToString(\"HH:mm:ss\")", true)]
    public string Expression;

    [SuffixLabel("Suffix with icon", SdfIconType.HeartFill)]
    public string IconAndText1;

    [SuffixLabel(SdfIconType.HeartFill)]
    public string OnlyIcon1;

    [SuffixLabel("Suffix with icon", SdfIconType.HeartFill, Overlay = true)]
    public string IconAndText2;

    [SuffixLabel(SdfIconType.HeartFill, Overlay = true)]
    public string OnlyIcon2;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1936846.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

TeamViewer手机端APP提示:请先验证账户

当你在手机端下载安装了TeamViewerAPP后&#xff0c;需要你先登录个人账号&#xff0c;然后还会要求你验证账户&#xff0c;同时跳转到一个网址中&#xff0c;但是这个网址并没有自动跳转到验证账户的位置。 解决办法&#xff1a; 在手机浏览器中进入下面这个网址&#xff1a;…

时序数据库如何选型?详细指标总结!

工业物联网场景&#xff0c;如何判断什么才是好的时序数据库&#xff1f; 工业物联网将机器设备、控制系统与信息系统、业务过程连接起来&#xff0c;利用海量数据进行分析决策&#xff0c;是智能制造的基础设施&#xff0c;并影响整个工业价值链。工业物联网机器设备感知形成了…

ubuntu 24 PXE Server (bios+uefi) 批量部署系统

pxe server 前言 PXE&#xff08;Preboot eXecution Environment&#xff0c;预启动执行环境&#xff09;是一种网络启动协议&#xff0c;允许计算机通过网络启动而不是使用本地硬盘。PXE服务器是实现这一功能的服务器&#xff0c;它提供了启动镜像和引导加载程序&#xff0c;…

以Zookeeper为例 浅谈脑裂与奇数节点问题

一、脑裂现象的定义与影响 脑裂&#xff08;split-brain&#xff09;是指在分布式系统中&#xff0c;因网络分区或其他故障导致系统被切割成两个或多个相互独立的子系统&#xff0c;每个子系统可能独立选举出自己的领导节点。这一现象在依赖中心领导节点&#xff08;如Elastic…

MVC架构在Web开发中的实现

MVC架构在Web开发中的实现 1、MVC架构概述2、MVC架构的实现 &#x1f496;The Begin&#x1f496;点点关注&#xff0c;收藏不迷路&#x1f496; 在Web开发领域&#xff0c;MVC&#xff08;Model-View-Controller&#xff09;架构模式是一种广泛使用的软件设计模式&#xff0c…

数据可视化配色新工具,颜色盘多达2500+类

好看的配色,不仅能让图表突出主要信息,更能吸引读者,之前分享过很多配色工具,例如, 👉可视化配色工具:颜色盘多达3000+类,数万种颜色! 本次再分享一个配色工具pypalettes,颜色盘多达2500+类。 安装pypalettes pip install pypalettes pypalettes使用 第1步,挑选…

在VS Code上搭建Vue项目教程(Vue-cli 脚手架)

1.前期环境准备 搭建Vue项目使用的是Vue-cli 脚手架。前期环境需要准备Node.js环境&#xff0c;就像Java开发要依赖JDK环境一样。 1.1 Node.js环境配置 1&#xff09;具体安装步骤操作即可&#xff1a; npm 安装教程_如何安装npm-CSDN博客文章浏览阅读836次。本文主要在Win…

哪种SSL证书可以快速签发保护http安全访问?

用户访问网站&#xff0c;经常会遇到访问http网页时&#xff0c;提示网站不安全或者不是私密连接的提示&#xff0c;因为http是使用明文传输&#xff0c;数据传输中可能被篡改&#xff0c;数据不被保护&#xff0c;通常需要SSL证书来给数据加密。 SSL证书的签发速度&#xff0…

Selenium之execute_script()方法执行js脚本

目录 场景应用和使用 页面滚动 获取返回值 返回JavaScript定位的元素对象 修改元素属性 弹出提示框 场景应用和使用 在自动化测试中&#xff0c;部分场景无法使用自动化Selenium原生方法来进行测试&#xff1a; 滚动到某个元素&#xff08;位置&#xff09; 修改…

数据分析入门指南:数据库入门(五)

本文将总结CDA认证考试中数据库中部分知识点&#xff0c;内容来源于《CDA模拟题库与备考资料PPT》 。 CDA认证&#xff0c;作为源自中国、面向全球的专业技能认证&#xff0c;覆盖金融、电信、零售、制造、能源、医疗医药、旅游、咨询等多个行业&#xff0c;旨在培养能够胜任数…

STM32 TIM定时器从模式控制器

TIM 从模式控制器 从模式控制器控制框图 从机模式 /** defgroup TIM_Slave_Mode TIM Slave mode* {*/ #define TIM_SLAVEMODE_DISABLE 0x00000000U /*!< Slave mode disabled */ #define TIM_SLAVEMOD…

IDEA创建Java工程、Maven安装与建立工程、Web工程、Tomcat配置

《IDEA破解、配置、使用技巧与实战教程》系列文章目录 第一章 IDEA破解与HelloWorld的实战编写 第二章 IDEA的详细设置 第三章 IDEA的工程与模块管理 第四章 IDEA的常见代码模板的使用 第五章 IDEA中常用的快捷键 第六章 IDEA的断点调试&#xff08;Debug&#xff09; 第七章 …

[C++]优先级队列

1 .了解优先级队列 优先级队列是一种容器适配器&#xff0c;根据一些严格的弱排序标准&#xff0c;专门设计使其第一个元素始终是它所包含的元素中最大的元素。 此上下文类似于堆&#xff0c;其中可以随时插入元素&#xff0c;并且只能检索最大堆元素&#xff08;优先级队列中顶…

idea2019版本创建JavaWeb项目并配置Tomcat步骤

一、创建JavaWeb项目 1.新建项目File->New->Project 2. 选择JavaWeb应用在New Project窗口中选择Java后勾选Java EE中的Web Application后点击next即可 3.设置项目名称后点击finish即可 4.至此项目创建完成&#xff0c;检查文件是否齐全&#xff0c;开始配置Tomcat 二、…

【iOS】——消息传递底层实现

消息传递是什么 Objective-C是一种动态类型语言&#xff0c;这意味着在编译时并不确定对象的具体类型&#xff0c;而是在运行时决定。消息传递机制允许程序在运行时向对象发送消息&#xff0c;对象再决定如何响应这些消息。 当你通过对象调用方法时&#xff0c;例如像这样[ob…

React 从入门到实战 一一开发环境基础搭建(小白篇)

React 从入门到实战一一开发环境基础搭建&#xff08;小白篇&#xff09; React 介绍什么是 react &#xff1f;react 主要功能react 框架特点 开发工具渲染测试 React 介绍 最近两年&#xff0c;react 也愈来愈火热&#xff0c;想要在里面分一杯羹&#xff0c;那肯定逃不过 r…

CentOS 7开启SSH连接

1. 安装openssh-server 1.1 检查是否安装openssh-server服务 yum list installed | grep openssh-server如果有显示内容&#xff0c;则已安装跳过安装步骤&#xff0c;否则进行第2步 1.2 安装openssh-server yum install openssh-server2. 开启SSH 22监听端口 2.1 打开ssh…

阿里云盾占用资源的问题AliYunDun,AliYunDunUpdate

目录 1.关闭AliYunDunUpdate&#xff0c;AliYunDun&#xff0c;AliYunDunMonitor。 2.发现报错如下 3.打开阿里云安全中心控制台 4.成功解决 2.开启云盾命令 “如果您在解决类似问题时也遇到了困难&#xff0c;希望我的经验分享对您有所帮助。如果您有任何疑问或者想分享您…

【考研数学】线代满分经验分享+备考复盘

我一战二战复习都听了李永乐的线代课&#xff0c;二战的时候只听了一遍强化&#xff0c;个人感觉没有很乱&#xff0c;永乐大帝的课逻辑还是很清晰的。 以下是我听向量这一章后根据听课内容和讲义例题总结的部分思维导图&#xff0c;永乐大帝讲课的时候也会特意点到线代前后联…

spark shell

1.进行shell命令行 spark-shell 2.创建RDD 2.1 读取文件创建RDD 2.1.1读取linux文件系统的文件创建RDD --需要保证每一个worker中都有该文件 val data1 sc.textFile("file:/opt/file/word.txt") 2.1.2读取hdfs文件系统上的文件创建RDD val data2sc.textFile("…