Tag: uisegmented控制

用徽章或突出显示的UISegmentedControl

偶尔我想突出显示UISegmentedControl一个片段,即第三个标题是“新闻”,我想引起用户的注意。 理想情况下,与UITabBar上的红色徽章和数字 – 任何想法如何实现? 随意分享其他的想法。 我想把徽章作为一个图像添加到它的顶部,但也许有更好的方法。

将一个CustomBadge添加到navigationBar中的UISegmentedControl

navigationBar有一个UISegmentedControl ,它在Storyboard中创build,并有一个Outlet连接到它。 我试图添加一个自定义徽章到UISegmentedControl ,但失败了。 徽章不出现。 PS。 当我将它添加到navigationBar ( UISegmentedControl的超级视图)时出现自定义徽章,但它是我的第二种方法。 我想直接添加到UISegmentedControl ,可以吗? MyTableViewController.h … @interface MyTableViewController : UITableViewController{ } @property (strong,nonatomic) IBOutlet UISegmentedControl *segmentedControl; … MyTableViewController.m @synthesize segmentedControl; … – (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; CustomBadge *customBadge = [CustomBadge customBadgeWithString:@"1" withStringColor:[UIColor whiteColor] withInsetColor:[UIColor orangeColor] withBadgeFrame:YES withBadgeFrameColor:[UIColor whiteColor] withScale:0.8 withShining:YES]; NSLog(@"self.segmentedControl :%@",self.segmentedControl); NSLog(@"self.segmentedControl w: %f, h :%f",self.segmentedControle.frame.size.width, self.segmentedControlle.frame.size.height); […]