小编Oct*_*tan的帖子

UIAlertController 中的组或分隔符与新音乐应用程序中一样

我想知道是否有人知道一种创建 UIAlertController 作为操作表的方法,该操作表看起来像 iOS 8.4 中新音乐应用程序中的操作表

\n\n

我想要的是将按钮分成几组,如下图所示。正如您所看到的,“Crear una lista Genius”和“A\xc3\xb1adir a una lista...”之间有一个空格。

\n\n

谢谢。

\n\n

音乐应用截图

\n

xcode uiactionsheet ios uialertcontroller

5
推荐指数
1
解决办法
2131
查看次数

prepareForSegue和popViewController的兼容性

这个问题

我正在开发一个iOS应用程序,我连续3次ViewControllers:

TableViewController- > DetailViewController- >ImageViewController

我用一个按钮执行de forward Segue(只需控制拖动Storyboard)然后返回我有一个自定义后退按钮

[self.navigationController popViewControllerAnimated:YES];
Run Code Online (Sandbox Code Playgroud)

要发送数据,我使用

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    [segue.destinationViewController someFunction];
}
Run Code Online (Sandbox Code Playgroud)

为了将数据发送到父ViewController,我可以使用prepareForSegueDetailViewController,但它不工作ImageViewController,有我一定要使用Notifications.

我可以使用prepareForSegue发送数据popViewControllerAnimated吗?

在这两种情况下我都应该使用通知吗?

一些代码

我所拥有的DetailViewController是一个按钮,它执行Seview到ImageViewController(只是控制拖动Storyboard)和一个后退按钮:

- (IBAction)backAction:(id)sender {
     [self.navigationController popViewControllerAnimated:YES];
}
Run Code Online (Sandbox Code Playgroud)

然后功能:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if([segue.identifier isEqualToString:@"forwardSegue"]) {
        [segue.destinationViewController someFuntionToImageViewController];
    } else {
        [segue.destinationViewController someFuntionToParentViewController];
    }
}
Run Code Online (Sandbox Code Playgroud)

我注意到我无法为popViewController动作分配segue.identifier .

iphone xcode ios uistoryboardsegue

2
推荐指数
1
解决办法
7132
查看次数

UITextView 禁用换行

我正在为iOS 7iOS 8制作一个应用程序,我想在我的UITextView. 我有一些 ASCII 表,我不希望它们被破坏。

我在故事板中没有找到该选项,我尝试以编程方式执行此操作。我努力了:

[textView setContentSize:[[textView attributedText] size]];
Run Code Online (Sandbox Code Playgroud)

[textView.textContainer setSize:[[textView attributedText] size]];
Run Code Online (Sandbox Code Playgroud)

似乎什么都不起作用。

xcode objective-c word-wrap uitextview ios

2
推荐指数
1
解决办法
6423
查看次数