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
          主站蜘蛛池模板: 资中县| 太仆寺旗| 策勒县| 扎兰屯市| 普洱| 寿阳县| 新巴尔虎左旗| 永平县| 双城市| 惠水县| 河曲县| 永泰县| 岐山县| 手游| 日照市| 宜城市| 沾化县| 耒阳市| 高雄县| 三原县| 旺苍县| 和平县| 金山区| 乳源| 南丹县| 永清县| 大竹县| 莱阳市| 游戏| 安化县| 阿图什市| 田林县| 武乡县| 新郑市| 万山特区| 四平市| 驻马店市| 班戈县| 卢龙县| 凤阳县| 柘城县|