Sealyu

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

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            618 隨筆 :: 87 文章 :: 225 評(píng)論 :: 0 Trackbacks

          I’m back to programming and currently developing application for iPad. I needed something, what looked like a simplest thing – UITableView taking a portion of screen and SplitViewController wasn’t attractive option. To my surprise non of the obvious to me solutions worked until I’ve tried not-so-elegant reallocating of tableView.

          So, in myTableViewController I created custom init function:

          - (id) initWithFrame:(CGRect)frm {
          if ((self = [super initWithStyle: UITableViewStylePlain])){
          self.tableView = [[UITableView alloc] initWithFrame:frm style:UITableViewStylePlain];
          }
          return self;
          }

          Obviously, you can use default or your own init function or avoid passing frame argument and hardcode dimensions right here, but the magical line is:

          self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(x, y, width, height) style:UITableViewStylePlain];

          Well, at least it worked for me.

          posted on 2010-10-08 10:40 seal 閱讀(237) 評(píng)論(0)  編輯  收藏 所屬分類: iPhone
          主站蜘蛛池模板: 焉耆| 铜山县| 双辽市| 米泉市| 兰溪市| 勃利县| 汉寿县| 乌拉特前旗| 望谟县| 平陆县| 栖霞市| 河津市| 北宁市| 宝兴县| 左权县| 黄骅市| 临汾市| 宁都县| 蓝山县| 堆龙德庆县| 榆林市| 涟水县| 乡宁县| 合作市| 新巴尔虎右旗| 峨眉山市| 隆林| 三河市| 德钦县| 合作市| 曲靖市| 霞浦县| 昌图县| 光泽县| 五峰| 蓝山县| 临沧市| 怀集县| 南京市| 剑阁县| 唐海县|