UIActionSheet Title Multiline

微笑、不失礼 提交于 2019-12-12 04:49:17

问题


Very simply I'd like to have the title of the UI Action Sheet be two lines.

See example below. I'd like to make it:

(line1) Action

(line2) Sheet Demo

Still centered and everything just with a carriage return


回答1:


so because it takes NSString * you need to use \r

    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"First Line\rSecond Line", nil)
                                                         delegate:self
                                                cancelButtonTitle:NSLocalizedString(@"_CANCEL", nil)
                                           destructiveButtonTitle:nil
                                                otherButtonTitles:NSLocalizedString(@"_USE_SYSTEM_LANGUAGE", nil), NSLocalizedString(@"_ENGLISH", nil), NSLocalizedString(@"_ARABIC", nil), nil];

it is copy&paste I use NSLocalizedString but you ncat use NSString



来源:https://stackoverflow.com/questions/26408571/uiactionsheet-title-multiline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!