开发者

Retrieve UISegmentedControl object out of UIBarButtonItem

开发者 https://www.devze.com 2023-03-10 02:58 出处:网络
I need to get the UISegmentedControl object that i previously added in the UIBarButtonItem like this UIBarButtonItem *segmentBarButton=[[UIBarButtonItem alloc] initWithCustomView:segmaentControl];

I need to get the UISegmentedControl object that i previously added in the UIBarButtonItem like this

UIBarButtonItem *segmentBarButton=[[UIBarButtonItem alloc] initWithCustomView:segmaentControl];

now i want to get the UISegmentedControl obje开发者_JAVA百科ct out of it, how can i do this?


UIBarButtonItem has a property called customView, which is what you're looking for:

UISegmentedControl *control = (UISegmentedControl *) [segmentBarButton customView];
0

精彩评论

暂无评论...
验证码 换一张
取 消