zoukankan      html  css  js  c++  java
  • 别人写的 代码,

    当component 一直是零的时候,那么 就 修改 row的数值了。。。

    - (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated

    {

        [super selectRow:row inComponent:component animated:animated];

        if (row < 0) {

            row = 0;

        }

        else if (row > [self numberOfRowsInComponent:component]) {

            row = [self numberOfRowsInComponent:component] - 1;

        }

        int lastIndex = [self selectedRowInComponent:component];

        if (lastIndex != row) {

            PickerCellView* cellView = (PickerCellView*)[self viewForRow:lastIndex forComponent:component];

            cellView.selected = NO;

            cellView = (PickerCellView*)[self viewForRow:row forComponent:component];

            cellView.selected = YES;

        }

        [self.selectionDicsetValue:[NSNumbernumberWithInt:row] forKey:[NSStringstringWithFormat:@"%d", component]];

    }

  • 相关阅读:
    Razor 常用又容易忘记语法
    游览器 reflow
    正则表达式
    migration to end point routing
    js 翻译 c# 注意事项
    Angular 学习笔记 work with excel (导出 excel)
    html4,5 basic
    IIS 服务器配置
    meta 的用途
    正则表达 常用
  • 原文地址:https://www.cnblogs.com/guligei/p/3170046.html
Copyright © 2011-2022 走看看