Figure out UIBarButtonItem frame in window?

前端 未结 11 1922
臣服心动
臣服心动 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:05

    -(CGRect) getBarItemRc :(UIBarButtonItem *)item{
        UIView *view = [item valueForKey:@"view"];
        return [view frame];
    }
    

提交回复
热议问题