<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Sealyu

    --- 博客已遷移至: http://www.sealyu.com/blog

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      618 隨筆 :: 87 文章 :: 225 評論 :: 0 Trackbacks

    The iPhone SDK provides an easy-to-code standard for creating consistent user interfaces. The UITableView class is used in many iPhone applications. Most applications that present information to you in rows that you can tap to slide a new page over to see details use a UITableView to do the magic. Once you have a UITableView setup, you can easily add the little accessory arrow icons to the right side of the table cells by following the steps in this Tech-Recipe.


    At this point, you need to have a working UITableView-based application. If you aren’t at this point, you’ll need to take a few steps back and check with the official Apple iPhone SDK documentation.

    The simplest case is adding an accessory icon to the right of all cells in the table. To do this, edit the source file of the table view you want to change and add the following method:

    - (UITableViewCellAccessoryType)tableView:(UITableView *)tv accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath
    {
       return UITableViewCellAccessoryDetailDisclosureButton;
    }

    Yeah, that’s a keyboard-full, but it’s not that bad. Because your table view class is the delegate of your actual table view, implementing this method of the UITableViewController class will automatically affect the cells in your table. No other changes are needed to make this work. Very cool.

    If you don’t want to show the accessory image for every cell in the table, you’ll need to implement some logic in this method that takes the NSIndexPath parameter (which tells you which row in which section is being asked about) and responds appropriately.

    There are three standard accessory images that can be used by this method. Each image is shown below with the matching UITableViewCellAccessoryType (the example uses shows a Disclosure indicator image because it returns UITableViewCellAccessoryDisclosureIndicator.

    Disclosure indicator

    UITableViewCellAccessoryDisclosureIndicator
    Used to indicate that tapping the cell will slide in a new table view one level down in the hierarchy.


    Detail disclosure button

    UITableViewCellAccessoryDetailDisclosureButton
    This button indicates that tapping the cell will reveal a detail view of that item.


    Checkmark

    UITableViewCellAccessoryCheckmark
    Indicates that a row has been selected by the user.


    Nothing

    UITableViewCellAccessoryNone
    This is the default value for the cell accessory indicating that no accessory should be shown.

    This isn’t a brain surgery level Tech-Recipe and this information is, of course, covered in the official documentation, but I keep forgetting the method name and knew it would be easier to lookup here than in the docs. I hope someone else finds it helpful, too.

    posted on 2010-10-07 20:21 seal 閱讀(511) 評論(0)  編輯  收藏 所屬分類: iPhone
    主站蜘蛛池模板: 免费一级毛suv好看的国产网站 | 国产区图片区小说区亚洲区| 亚洲中文字幕无码爆乳av中文| 污污网站免费观看| 一级看片免费视频囗交| 亚洲国产成人九九综合| 亚洲精品国产精品乱码不卡√| 国内免费高清在线观看| 中文字幕亚洲免费无线观看日本| 免费手机在线看片| 国产亚洲精品第一综合| 亚洲午夜无码久久久久小说 | 日本免费高清视频| 99精品免费视品| 最好免费观看高清在线 | 亚洲成a人在线看天堂无码| 国产人妖ts在线观看免费视频| 国产精品视频永久免费播放| 精品熟女少妇a∨免费久久| 无码乱人伦一区二区亚洲一| 一级毛片免费毛片毛片| 成年大片免费高清在线看黄| 国产亚洲午夜精品| 青青草97国产精品免费观看| 老司机亚洲精品影院| 亚洲日本在线观看视频| 免费无码精品黄AV电影| 又粗又大又硬又爽的免费视频| 免费A级毛片无码A∨男男| 亚洲欧洲日本在线| 亚洲成a人片在线观看无码| 亚洲精品视频在线观看免费| 亚洲伊人久久大香线蕉啊| 亚洲av无码专区国产不乱码| 深夜a级毛片免费视频| 99精品免费视频| 毛片大全免费观看| 亚洲AV无码欧洲AV无码网站| 老司机亚洲精品影院无码| 亚洲精品无码aⅴ中文字幕蜜桃| 春暖花开亚洲性无区一区二区|