Sealyu

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

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            618 隨筆 :: 87 文章 :: 225 評論 :: 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 閱讀(248) 評論(0)  編輯  收藏 所屬分類: iPhone
          主站蜘蛛池模板: 海盐县| 正定县| 白朗县| 木里| 甘洛县| 荔浦县| 旌德县| 苏州市| 鄂托克旗| 腾冲县| 阜阳市| 东乌珠穆沁旗| 井冈山市| 措美县| 邓州市| 哈尔滨市| 大埔区| 山西省| 井冈山市| 尉氏县| 湘潭县| 宜川县| 大方县| 荔浦县| 罗源县| 六盘水市| 怀集县| 临安市| 巴林右旗| 杭锦后旗| 兴文县| 辽阳县| 宜良县| 石景山区| 临城县| 炎陵县| 台北市| 松滋市| 宣恩县| 蛟河市| 泰来县|