UIAlertView文本格式

编程入门 行业动态 更新时间:2024-10-27 10:32:16
本文介绍了UIAlertView文本格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好我想知道是否可以改变uialertview的文本格式。也就是

消息你赢了,但用赢字粗体显示。

看来,唯一的解决办法是为我创建自己的弹出窗口。

有什么想法?

谢谢

解决方案

目前这是不可能的。你必须创建一个自定义 UIAlertView 。

从类参考:

$ b $这是唯一的选择,因为它不是子类。 b

子类化注释 UIAlertView类的使用原样是,不支持子类化。这个类的视图层次是 private,不能被修改。

虽然有开源的版本。有一个自定义UIAlertView搜索,你会很容易找到它们。例如,看到这个问题的一些链接:

自定义UIAlertView?

Hi I was wondering if it is possible to change the text formatting of the uialertview. i.e

The message "You have won" but with the "won" word in bold.

I looked around and it seems that the only solution is for me to create my own popup.

any ideas?

Thanks

解决方案

This isn't possible at present. You'd have to create a custom UIAlertView. That's the only option as it is not to be subclassed.

From the Class Reference:

Subclassing Notes The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

There are open source versions out there though. Have a search on "Custom UIAlertView" and you'll easy find them. For example see this question for some links:

Custom UIAlertView?

更多推荐

UIAlertView文本格式

本文发布于:2023-10-15 01:27:05,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本   格式   UIAlertView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!