UIPickerView组件的默认宽度是多少? [英] What is the default width of a UIPickerView component?

查看:40
本文介绍了UIPickerView组件的默认宽度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找出正确的答案应该很简单吗?它在Apple文档中的何处列出了各种UI组件的任何默认值?

Should be simple to find out right? Where in the Apple docs does it list any default values for various UI components?

我尝试调用协议的方法:

I've tried calling the protocol's method:

CGFloat width = [self pickerView:pickerView widthForComponent:0];

...但是没有运气.如何找出该默认值?

...but no luck. How do i find out this default value?

推荐答案

我以前没有尝试过,但是也许...

I haven't tried this before but maybe...

viewForRow:forComponent:

viewForRow:forComponent: http://developer.apple.com/iphone/library/documentation/uikit/reference/UIPickerView_Class/Reference/UIPickerView.html#//apple_ref/occ/instm/UIPickerView/viewForRow:forComponent:

然后从返回的UIView中获取宽度

then get the width from the UIView returned

这篇关于UIPickerView组件的默认宽度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆