我想設置的UIButton的標籤與二維數組 - >如何設置的UIButton的標籤與二維數組
這裏我的代碼,不知道我錯了。
for(int i = 0 ; i<[arrWeekly_Fetch_DataForLandscapeMode count] ; i++)
{
btnLandscape_Button = [UIButton buttonWithType:UIButtonTypeCustom];
btnLandscape_Button.backgroundColor = [UIColor clearColor];
btnLandscape_Button.frame = CGRectMake(0,0,200,50);
[btnLandscape_Button.titleLabel setFont:[UIFont systemFontOfSize:14]];
btnLandscape_Button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[arrCommonDays[1][i] addObject:[arrWeekly_Fetch_DataForLandscapeMode objectAtIndex:i]];
[btnLandscape_Button setTag:[1][arrWeekly_Fetch_DataForLandscapeMode objectAtIndex:i]];
[btnLandscape_Button addTarget:self action:@selector(btnClick_ForDetailInformation_For_Class_InLandscapeMode:) forControlEvents: UIControlEventTouchUpInside];
[btnLandscape_Button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[viewForDisplayData_OnDaily addSubview:btnLandscape_Button];
[btnLandscape_Button setTitle:[dictWeeklyData_InLandscape_Mode objectForKey:@"sSubjectCode"] forState:UIControlStateNormal];
}
如果你想創建一個網格視圖然後我可以幫助創建這個並添加標籤並訪問每個按鈕,並可以更改每個按鈕的圖像,當你想 – GhostRider 2011-02-25 06:32:58
感謝回覆。你能幫我一樣嗎? – iGW 2011-02-25 09:43:26