相关疑难解决方法(0)

Swift窗口视图上的子视图

我想在整个屏幕上放置一个UIView(包括导航栏).该视图将为黑色,具有0.3不透明度.我想这样做是为了使屏幕内容变暗并在此基础上推送视图.我正在使用此代码:

UIApplication.sharedApplication().keyWindow?.addSubview(darkView)
Run Code Online (Sandbox Code Playgroud)

这按预期覆盖整个屏幕.但是我现在想在这个黑暗的视图之上放置另一个视图.有没有办法做到这一点?我尝试的一切只会导致视图处于黑暗视野之下.任何指针都会非常感激!谢谢

uiview ios swift

34
推荐指数
4
解决办法
5万
查看次数

UITableView,让页脚停留在屏幕的底部?

我有一个带页脚的UITableView,在自定义视图中填充了tabBar,使用以下代码完成:

- (CGFloat)tableView:(UITableView *)tableView
heightForFooterInSection:(NSInteger)section {
    //differ between your sections or if you
    //have only on section return a static value
    return 49;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {

    if(footerView == nil) {
        //allocate the view if it doesn't exist yet
        footerView  = [[UIView alloc] init];
        [footerView addSubview:self.tabBarView];
    }

    //return the view for the footer
    return footerView;
}
Run Code Online (Sandbox Code Playgroud)

哪个工作很可爱,除了当桌子的行数少于填充屏幕所需的行数时,这会导致页脚向上移动,因为桌子不再创建空行,因为有一个页脚.

那么,有没有人知道如何将自定义页脚锁定到屏幕底部,或者,使tableView像以前一样创建空行?

谢谢!

加雷思

iphone cocoa-touch objective-c

25
推荐指数
1
解决办法
3万
查看次数

标签 统计

cocoa-touch ×1

ios ×1

iphone ×1

objective-c ×1

swift ×1

uiview ×1