小编Sam*_*Dos的帖子

白色空间代替隐藏的标签栏

UINavigationController在里面使用UITabBarController,我的导航控制器中的一个屏幕是一个UIImageView.当我想要全屏显示图像时,我必须隐藏导航栏和标签栏.我可以正确隐藏导航栏但是当我隐藏标签栏时,它会留下50px的空白区域.有什么建议吗?

uinavigationbar uitabbarcontroller uinavigationcontroller uitabbar ios

9
推荐指数
1
解决办法
5059
查看次数

符合协议并保持私有财产

我需要在一致的类中使用协议属性作为私有.但是编译器拒绝这样做.我该如何实现呢?

protocol ProtocolX: class {
    var x: Int { get set }

    func performAnyActionOnX()
}

extension ProtocolX {
    func performAnyActionOnX() {
        x = 5
        print(x)
    }
}

class A: ProtocolX {
    private var x:Int = 7
}
Run Code Online (Sandbox Code Playgroud)

谢谢.

architecture protocols private swift

6
推荐指数
2
解决办法
3745
查看次数

UITableview与图像滚动非常慢

我有一个UITableView从服务器下载其tableviewcells图像.

我观察到桌子滚动得很慢.

我认为这可能是由于下载,但我已经意识到下载完成后表格仍然滚动缓慢,图像图标大小非常少.

代码:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    btnBack.hidden = FALSE;

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil)
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;

        /////////////////////   Cell other accessories    /////////////////////
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.backgroundColor = [UIColor clearColor];
//        cell.backgroundView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"list_1.jpg"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0]];
//        cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"list_2.jpg"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0]];

        /////////////////////   Cell Title    /////////////////////
        cell.textLabel.font = [UIFont fontWithName:@"Noteworthy" size:17.0];
        cell.textLabel.font = …
Run Code Online (Sandbox Code Playgroud)

iphone scroll ios

4
推荐指数
1
解决办法
3400
查看次数

decode中的Xcode retaincount = 1

我想知道为什么一个对象的重新计数在它的dealloc函数中等于一个.

-(void) dealloc 
{
   NSlog(@"retain count = %i ", [self retaincount]);
   [super dealloc];
}
Run Code Online (Sandbox Code Playgroud)

保留count = 1所以对象如何调用其dealloc函数,尽管它的保留计数等于1.据我所知,当对象的保留计数仅等于零时,该对象会调用此函数.

iphone objective-c

2
推荐指数
1
解决办法
757
查看次数