Recently in iPhone 程式開發 Category

為UITableViewCell增加背景圖片

| No Comments | No TrackBacks
雖然不是很了不起的知識, 但也是我找了許久終於找到的答案. 

要使UITableViewCell的背景換成自己喜歡的, 很簡單...

 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

        if (cell == nil) {
            cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.png"]];// 套用自己的圖片做為背景
            CGRect CellFrame = CGRectMake(0, 0, 300, 60);
        CGRect Label1Frame = CGRectMake(10, 5, 288, 38);
   UILabel *lblTemp;
   UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CellFrame reuseIdentifier:cellIdentifier] autorelease];
   lblTemp = [[UILabel alloc] initWithFrame:Label2Frame];
   lblTemp.backgroundColor = [UIColor clearColor];//清除預設的背景顏色
   lblTemp.tag = 1;
   lblTemp.font = [UIFont boldSystemFontOfSize:15];
   lblTemp.numberOfLines = 2;
   [cell.contentView addSubview:lblTemp];
   [lblTemp release];
        }

UILabel *lblTemp1 = (UILabel *)[cell viewWithTag:1];
lblTemp1.text = @"AAAAA";
        return cell;
}

我的iPhone應用程式的開發體驗

| No Comments | No TrackBacks
   我的iPhone應用程式的開發體驗

在開始開發iPhone的應用程式之前, 其實我完全沒碰過iPhone, MAC OS 以及 iPhone 應用程式的開發語言.  我是以一個類似盲人摸象的方式開始玩MAC OS 以及開發語言.

   會接觸iPhone開發語言也是逼不得已的一件事.

   這可要追溯到1個多星期以前, 我忽然接到經理的通知, 要我出發到首都的分公司進行iPhone應用程式開發兩個星期.  說實在, 我委實嚇著了.  公司竟然要一個從來沒有接觸過MAC OS 以及iPhone的人在兩個星期內完成應用程式/軟體的開發, 這是什麼國際笑話?


About this Archive

This page is an archive of recent entries in the iPhone 程式開發 category.

PHP 技術 is the next category.

Find recent content on the main index or look in the archives to find all content.