早教吧作业答案频道 -->其他-->
如何取得TALBEVIEW中cell.backgroundView中的某个对象?我的代码如下:-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{……//添加CELL的背景图片UIImageView*vbgCell=[[U
题目详情
如何取得TALBEVIEW中cell.backgroundView 中的某个对象?我的代码如下:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{…… //添加CELL的背景图片 UIImageView *vbgCell = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,228,40)]; vbgCell.image = [UIImage imageNamed:@"sLine_playlist.png"]; //添加CELL选中时的背景图片 UIImageView *vbgCellB = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,228,40)]; vbgCellB.image = [UIImage imageNamed:@"sLine_playlistB.png"]; [cell.backgroundView addSubview:vbgCellB]; [cell.backgroundView addSubview:vbgCell];……}//选中单元格所产生事件-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ //伪码如下 cell.backgroundView.其中的一个对象.alpha = 0; 这里我想获取CELL中包含对象的数组,然后得到其中指定的一个对象进行修改设置,请问应该怎么写? }
▼优质解答
答案和解析
OK,我现在找到方法了://添加CELL的背景图片 UIImageView *vbgCell = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,228,40)]; vbgCell.image = [UIImage imageNamed:@"sLine_playlist.png"]; cell.backgroundView = vbgCell; UIImageView *vbgCellB = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,228,40)]; vbgCellB.image = [UIImage imageNamed:@"sLine_playlist.pngB"]; cell.selectedBackgroundView = vbgCellB;不过在点击的时候并没有显示选中时的背景图片。
看了如何取得TALBEVIEW中c...的网友还看了以下:
数码摄象机光学取景器与电子取景器有什么区别?光学取景器与电子取景器有什么区别?哪个好?好在哪里?数 2020-05-16 …
M是放在水平左面的物体,两边用细线通过滑轮与吊盘相连.若在左盘中放重为10N的砝码、右盘中放重为2 2020-05-20 …
空间直角坐标系八卦限顺序为什么这样规定?均是按x,y,z的次序I:+++II:-++III:--+ 2020-06-08 …
感激不尽啊.1、一艘船以速度u驶向码头,另一艘以速率v自码头离去,试证当两船的距离最短时,两船与码 2020-07-04 …
一汽船在静水中的速度为v,设水流的速度为v/2,汽船先顺流而下再逆流而上,在两码头间往返一次所需时 2020-07-09 …
V根据对话内容及所给的情景,填入对话中所缺单词Li:Jenny.Ihearyoucelebrate 2020-07-12 …
编码器八线A+B+Z+A-B-Z-V+V-,如何检测此编码器有否烧坏? 2020-07-14 …
只有A,B,Z的编码器叫省线式编码器.有A.B.Z.A-.B-.Z-.U.V.W.U-.V-.W- 2020-07-14 …
用UltraEdit软件观察“VB6.0中文版”这几个字符的内码,如图所示,下列描述中正确的是()A 2020-10-31 …
如何取得TALBEVIEW中cell.backgroundView中的某个对象?我的代码如下:-(U 2020-11-01 …