Back-like arrow on iOS 7

前端 未结 4 1303
深忆病人
深忆病人 2021-02-20 07:14

I need to add a left bar button item in my app that looks like system back button, but is not the system back button, since it will appear on view controller that is the only vc

4条回答
  •  滥情空心
    2021-02-20 08:00

    Try this:

    // After you create and place your backButton:
    
    UILabel* arrowLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, 20, 20)];
    arrowLabel.text = @"<";
    arrowLabel.textColor = [backButton titleColorForState:UIControlStateNormal];
    arrowLabel.transform = CGAffineTransformMakeScale(1,2);
    [backButton addSubview:arrowLabel];
    

    If addSubview gives you trouble, try

    [backButton insertSubview:arrowLabel atIndex:0];
    

提交回复
热议问题