【问题标题】:How to implement transitions between views via a UIPickerView in iOS application?如何在 iOS 应用程序中通过 UIPickerView 实现视图之间的转换?
【发布时间】:2013-01-16 16:57:41
【问题描述】:

我想实现一个自定义下拉菜单,它允许用户快速更改 iOS 应用程序中的视图。为此,我决定使用UIPickerView。但是我没有找到任何关于如何通过UIPickerView 更改视图的教程,所以我需要一些帮助和建议。代码示例会很有帮助。

【问题讨论】:

标签: ios objective-c uiview uipickerview


【解决方案1】:

下面的方法是UIPickerview 用于行选择的委托方法。

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:
(NSInteger)component    
{
    //in this method hide the views that you don't want to show and show the views that you
    //don't want to hide, when a particular row is selected.

    NSLog(@"row selected----->>%d",row);
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-28
    • 1970-01-01
    • 2015-03-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多