夜間モードのビューを持つリーダーアプリケーションがあります。つまり、ユーザーがUISwitchボタンをタップすると、tableview、text label.text、およびラベルの背景がわかりますすべてのものが完璧に動作しますが、バグは私がUIスイッチをタップするとバックグラウンドが最初に変わらず、テーブルビューをスクロールしてこのエフェクトを有効にする必要があります。背景に黒い画像がありますテーブルビューの.myコードはUITableViewにアクションを実装するときに不明なバグ
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
readCell *cell = (readCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"readCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
if (imagedarkbackground.hidden == NO)
{
cell.chapterAndVerse.backgroundColor= [UIColor clearColor];
cell.chapterAndVerse.textColor = [UIColor whiteColor];
cell.textLabel.textColor = [UIColor whiteColor];
cell.textLabel.highlightedTextColor = [UIColor whiteColor];
//cell.textLabel.font = [UIFont fontWithName:@"Georgia" size:16];
}
else if (imagedarkbackground.hidden == YES)
{
cell.chapterAndVerse.backgroundColor= [UIColor whiteColor];
cell.chapterAndVerse.textColor = [UIColor brownColor];
cell.textLabel.textColor = [UIColor darkGrayColor];
cell.textLabel.highlightedTextColor = [UIColor darkGrayColor];
}
です。私のコードに問題はありますか?なぜローライト効果を変更するにはどうすればいいですか? 。ありがとうございます。
をリロード(セル== nilの)場合(imagedarkbackground.hidden == NO)は、前の条件内であれば、あなたのですか? – saadnib
@saadnibは答えを得ました。単にテーブルrelodedtaをUISwitchのクリックカチオンに入れました。 – ICoder