iPhone: Adding Info button as right bar button item in navigation bar in code

前端 未结 4 396
北海茫月
北海茫月 2021-02-04 06:42

Has anyone had any success creating an info button (italic \'i\' in a circle) in code (read: without Interface Builder), and then assigning it as the right bar button item of a

4条回答
  •  悲哀的现实
    2021-02-04 07:26

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeInfoDark];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
    

提交回复
热议问题