UINavigationBar with buttons as title.

半城伤御伤魂 提交于 2019-12-05 01:20:50

You can just create your custom widget with the 5 star rating functionality and add it to the navigationItem

self.navigationItem.titleView = customWidget;

On top of my head, my suggestion would be that you try using UIToolbar and set it on top, and make it look like a navigationBar. It's fairly easy to implement it and add UIButtons and actions to it.

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
           action:@selector(chooseDataCenter:)
 forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"点我选择数据中心>" forState:UIControlStateNormal];
button.frame = CGRectMake(0, 0, 160.0, 40.0);

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