Figure out UIBarButtonItem frame in window?

前端 未结 11 1919
臣服心动
臣服心动 2020-11-28 02:58

UIBarButtonItem does not extend UIView, so there is nothing like a frame property.

But is there any way I can get what is it\'s CGRec

11条回答
  •  情话喂你
    2020-11-28 03:12

    I didn't see this option posted (which in my opinion is much simpler), so here it is:

    UIView *barButtonView = [barButtonItem valueForKey:@"view"];
    

提交回复
热议问题