文字弹窗支持换行

This commit is contained in:
shenjianxing 2024-12-18 09:48:53 +08:00
parent a08d48cb96
commit 4a060ea867

View File

@ -3,6 +3,7 @@ using UnityEngine.UI;
using QFramework;
using System.Collections.Generic;
using TMPro;
using System.Text.RegularExpressions;
namespace QFramework.Example
{
@ -25,7 +26,7 @@ namespace QFramework.Example
protected override void OnOpen(IUIData uiData = null)
{
mData = uiData as UITextTipData ?? new UITextTipData();
Des.text = mData.text;
Des.text = Regex.Replace(mData.text, @"\\n", "\n");
BtnContent.RemoveAllChildren();
foreach (var item in mData.btns)
{