繁体   English   中英

使用hmsegmentedcontrol时标题右侧的图像

[英]Image to the right of the title when using hmsegmentedcontrol

我正在使用HMSegmentedControl ,默认情况下,使用时图像会添加到标题的左侧:

- (instancetype)initWithSectionImages:(NSArray *)sectionImages
                sectionSelectedImages:(NSArray *)sectionSelectedImages 
                    titlesForSections:(NSArray *)sectiontitles;

有什么方法可以在标题的右侧添加图像而无需派生HMSegmentedControl代码?

sectionTitles可以是AttributedStrings的数组。 这些可以包含图像附件。 这样,您可以使用NSAttributedString api在标题中或其后的任何位置包含图像!

免责声明:简短看一下代码

由于尝试导致崩溃,因此似乎并非在所有情况下都有效。 我认为除了分叉之外别无选择

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM