【发布时间】:2013-10-11 07:43:37
【问题描述】:
V形之间的距离受UITableViewCell的宽度影响。如果小于 320 会更大。
为了清晰起见,我特意将 contentView 的背景设为绿色。
设置 UITableViewCell 的背景会使单元格不可见。
当表格处于编辑模式时,只有第一个 V 形变为移动单元格符号。
注意:我所有的 UITableViewCell 类都是使用特殊技术创建的。基本上我用 UITableViewCell 加载一个 xib,然后我要创建的单元格吸收该 UITableViewCell 的属性
这里是完整的代码:
-(id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
//[self vLoadMainBundle];
//self=(BGBaseTableViewCell *)self.view;
[self BaseInitialize];
}
return self;
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self BaseInitialize];
//[self vLoadMainBundle];
//self=(BGBaseTableViewCell *)self.view;
}
return self;
}
-(void) vLoadMainBundle
{
if ([self class] == [BGBaseTableViewCell class])
{
return;
}
NSString * className = NSStringFromClass([self class]);
[[NSBundle mainBundle] loadNibNamed:className owner:self options:nil];
}
-(void) vAfterLoadMainBundle
{
//self=self.view;
self.contentView.frame =self.view.contentView.frame;
self.frame=self.view.frame;
//self.contentView.frame=self.contentView.frame;
[self.contentView kidnapChildrenAndAttributes:self.view.contentView];
[self kidnapChildrenAndAttributes:self.view];
self.editingAccessoryType= self.view.editingAccessoryType;
self.accessoryType = self.view.accessoryType;
self.selectionStyle =self.view.selectionStyle;
//PO1(@(self.editingAccessoryType));
//PO1(@(self.accessoryType));
//PO1(@(self.selectionStyle));
while (false);
[self.view removeFromSuperview];
//self.view=nil;
PO(self.view);
PO(self.view.subviews);
self.view.hidden=true;
[self furtherCustomInitializer];
}
-(void)BaseInitialize
{
[self vLoadMainBundle];
[self vAfterLoadMainBundle];
}
在 iOS 6 上完美运行
我注意到我绘制东西的原始视图仍在绘制中。因此,
【问题讨论】:
-
你的问题到底是什么?
-
为什么以及如何解决这个问题?
标签: objective-c xcode5