2016-09-16 11 views
0

UITableViewでスタイルを設定する場合は、viewForFooterInSectionまたはviewForHeaderInSectionのようにしてください。UITableViewのセクションのUIViewをカスタマイズする方法は?

それがかのうですが、それを行う...私はheightForHeaderInSectionを使用してtitleForHeaderInSectionと高さを使用してタイトルを設定することができますが、私はbagroundの色、フォントサイズ、フォント、色などを設定したいですか?

+0

はい、UIViewを作成し、 'viewForHeaderInSection'を実装してから、ビューを返します。 –

+0

セクションヘッダーとフッターのビューに必要な操作を行うことができます。あなたが抱えている問題を明確にしてください。あなたの質問はあまり明確ではありません。 – rmaddy

+0

重複:http://stackoverflow.com/questions/15611374/customize-uitableview-header-section?rq=1 – iDevzilla

答えて

0

あなたはAppleによって提供されるこの委任方法でそれを行うことができます。

//for header 
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 
{ 
    UIView *myview = [[UIView alloc] init]; 
    //give size for veiw, background color, add label anything here 



    return myview; 
} 


//for footer 

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 
{ 
    UIView *myview = [[UIView alloc] init]; 
    //give size for veiw, background color, add label anything here 



    return myview; 
} 
関連する問題