我有UITableView滾動按預期。我希望桌子佔用80%的空間,並且我希望頂部有另一個物體。沒有什麼大不了的。我的問題是,我不希望表格頂部的對象滾動。任何幫助/如何做到這一點的例子將不勝感激。這在搜索欄中看到很多。謝謝。iPhone對象不可滾動
好吧,我明白了,但現在我缺乏執行力了。我怎樣才能在我的rootViewControler中添加代碼?我嘗試了以下,我看到兩個「標題」,但他們仍然都在滾動。我在RootViewController的
UIView *containerViewA =
[[[UIView alloc]
initWithFrame:CGRectMake(0, 0, 300, 60)]
autorelease];
UIView *containerViewB =
[[[UIView alloc]
initWithFrame:CGRectMake(10, 60, 300, 60)]
autorelease];
UILabel *headerLabelA =
[[[UILabel alloc]
initWithFrame:CGRectMake(10, 20, 300, 40)]
autorelease];
UILabel *headerLabelB =
[[[UILabel alloc]
initWithFrame:CGRectMake(10, 80, 300, 40)]
autorelease];
headerLabelA.textColor = [UIColor whiteColor];
headerLabelA.shadowColor = [UIColor blackColor];
headerLabelA.shadowOffset = CGSizeMake(0, 1);
headerLabelA.font = [UIFont boldSystemFontOfSize:22];
headerLabelA.backgroundColor = [UIColor clearColor];
headerLabelA.text = NSLocalizedString(@"A", @"");
headerLabelB.textColor = [UIColor whiteColor];
headerLabelB.shadowColor = [UIColor blackColor];
headerLabelB.shadowOffset = CGSizeMake(0, 1);
headerLabelB.font = [UIFont boldSystemFontOfSize:22];
headerLabelB.backgroundColor = [UIColor clearColor];
headerLabelB.text = NSLocalizedString(@"B", @"");
[containerViewB addSubview:headerLabelA];
[containerViewA addSubview:containerViewB];
[self.view addSubview:containerViewA];
Gary, 我可以看到,這在IB中工作,但是當我生成時,我沒有看到第二個UIView中的項目。我對這個新問題表示歉意。 – Daniel 2010-06-30 03:41:42
如果我無法看到您的IB項目或代碼抱歉,要知道發生了什麼問題有點困難。 – Gary 2010-06-30 04:13:59