小编Jua*_*uan的帖子

使用 NSMutableAttributedString 实现圆角

我认为我的问题很简单,但我在谷歌上找不到任何东西。我用来NSMutableAttributedString修改字符串中的样式,例如我使用此代码来更改背景颜色:

    [string addAttribute:NSBackgroundColorAttributeName value:[UIColor colorWithRed:0.4 green:0.8 blue:1 alpha:1] range:NSMakeRange(0,18)];
Run Code Online (Sandbox Code Playgroud)

我的问题是,我如何才能圆化这个背景的角落?
提前致谢。

objective-c ios nsmutableattributedstring

5
推荐指数
0
解决办法
3754
查看次数

如何实现水平滚动tableview

我需要在我的表格视图中进行水平滚动,我搜索了所有 Google 但没有找到任何内容,我就这样做了

CGRect tableFrame = CGRectMake(15, heightView-360, widthView+50, heightView-200);
UITableView *tableView = [[UITableView alloc]initWithFrame:tableFrame style:UITableViewStylePlain];
tableView.layer.cornerRadius=7;
tableView.rowHeight = 40;
tableView.sectionFooterHeight = myData.count;
tableView.sectionHeaderHeight = myData.count;
tableView.scrollEnabled = YES;
tableView.showsVerticalScrollIndicator = YES;
tableView.showsHorizontalScrollIndicator=YES;
tableView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
tableView.userInteractionEnabled = YES;
tableView.bounces = YES;
tableView.delegate = self;
tableView.dataSource = self;
[self.view addSubview:tableView];
Run Code Online (Sandbox Code Playgroud)

有什么问题吗?为什么不走横向滚动呢?

objective-c uitableview ios

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

在Swift中完成方法时执行一个操作

我希望在一个方法完成后执行一个操作,我在其他方法中执行一个方法,我希望第二个方法停止,直到第一个方法完成.

我有这个方法:

func ejecutarOBJC(){
    let txtNombre = self.view.viewWithTag(4) as? UITextField
    let textoNombre=txtNombre?.text
    let txtContra = self.view.viewWithTag(5) as? UITextField
    let textoContra=txtContra?.text


    let instanceOfCustomObject: SQLViewController =  SQLViewController()
    instanceOfCustomObject.nombre = textoNombre;
    instanceOfCustomObject.contra = textoContra;
    instanceOfCustomObject.obtenerExistenciaUsuario()

}
Run Code Online (Sandbox Code Playgroud)

还有另一种方法:

func otherMethod(){

    ejecutarOBJC()

//I want continue with that method when the execution of the other method finish

}
Run Code Online (Sandbox Code Playgroud)

iphone ipad ios swift ios9

-1
推荐指数
1
解决办法
2057
查看次数