Sealyu

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

            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(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 閱讀(236) 評(píng)論(0)  編輯  收藏 所屬分類: iPhone
          主站蜘蛛池模板: 上虞市| 兴义市| 泾川县| 乐陵市| 威信县| 察哈| 平顺县| 北海市| 临漳县| 治县。| 张家界市| 高陵县| 长白| 克什克腾旗| 丰县| 广平县| 罗平县| 梓潼县| 博爱县| 新邵县| 潞城市| 科技| 临沭县| 寻甸| 海南省| 寿阳县| 黄龙县| 岑溪市| 岳普湖县| 芦溪县| 甘肃省| 松阳县| 彭州市| 晋城| 利川市| 乐山市| 华阴市| 定日县| 贡山| 长武县| 华池县|