小编Tar*_*era的帖子

如何在iOS中给像卡一样的影子

我想像我的iOS应用程序中的图像一样给出类似卡片的阴影效果

在此输入图像描述

我在UITableViewCell上需要这个图像对我来说也不适用于具有阴影效果的单元格之间的间隙

objective-c uitableview ios

17
推荐指数
2
解决办法
2万
查看次数

我可以在UITableViewCell之间留出空间吗?

我想在每个表视图单元格中给出10个像素的空间.

我怎么能这样做?

现在所有的细胞都没有任何空间

在此输入图像描述

这是我的细胞功能

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

  static NSString *cellIdentifier = @"MyOrderCell";
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

  NSLog(@"%d",indexPath.row);


 if (cell == nil)
 {
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
    cell.backgroundColor = [UIColor clearColor];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
 }



 UILabel *orderid = (UILabel*)[cell.contentView viewWithTag:101];
 orderid.textColor = kMaroonColor;
 orderid.font = [UIFont fontWithName:kFontName size:kProductFont];
 orderid.text = [NSString stringWithFormat:@"ORDER ID : %@",contentDict[@"order_id"]];

 UILabel *date = (UILabel*)[cell.contentView viewWithTag:102];
 date.textColor = kMaroonColor;
 date.font = [UIFont fontWithName:kFontName size:kProductFont];

 NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitableview ios

9
推荐指数
2
解决办法
2万
查看次数

itunes Connect构建状态已处理很长时间,然后出现错误:ITC.apps.preReleaseBuild.errors.processingFailed

我提交的应用程序的版本为1.2.1,并构建版本为1.0。该应用程序已成功上传到iTunes connect,但是很长一段时间以来一直在显示处理过程,此后显示红色徽章并出现一些错误:ITC.apps.preReleaseBuild.errors.processingFailed

我应该上传新版本的应用程序还是对此有任何解决方案。

itunesconnect app-store ios

5
推荐指数
1
解决办法
3309
查看次数

sizeWithAttributes 返回带有换行符的错误大小 \n

我正在使用 NSString 的 sizeWithAttributes 方法来获取 NSString 的动态高度。

我的字符串是 @“这是地址行 1 \n 这是地址行 2”

但该方法仅返回 line1 的大小(在 \n 字符之前)

有没有办法在字符串大小中包含 \n ?

objective-c nsstring ios

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

如何在SourceTree中丢弃多个文件?

我能够丢弃源树中的更改但是如果我一次只选择多个仍然丢弃的多个,则必须一次选择1个文件.在源代码树中有没有办法同时丢弃多个文件?

我使用的是2.1版

version-control atlassian-sourcetree

4
推荐指数
2
解决办法
1954
查看次数

如何在 TextView iOS 中给文本添加渐变?

当我尝试使用渐变层时,我想在 UITextView 中的文本上提供渐变效果,并将其应用于完整的文本视图背景。我只是希望它应用于文本和背景花色应该分开。

我想要这样的输出:

在此输入图像描述

它是这样的:

在此输入图像描述

有人可以建议如何在 UITextView 上实现像第一张图像一样的输出吗

我专门寻找 UITextView 的解决方案,而不是 UILabel 或 UIView

uitextview ios swift

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

解析时JSONObjectWithData错误的小数位

在我的一个api中,我得到了响应表单服务器(如果将数据转换为字符串)

{"success":true,"order_id":102232,"Total":68.6,"delivery_time":"7:30PM-10:00PM","delivery_date":"2016-03-25"}
Run Code Online (Sandbox Code Playgroud)

但是当我使用同样的时候

[NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError];
Run Code Online (Sandbox Code Playgroud)

它的回归

{
Total = "68.59999999999999";
"delivery_date" = "2016-03-25";
"delivery_time" = "7:30PM-10:00PM";
"order_id" = 102232;
success = 1;
Run Code Online (Sandbox Code Playgroud)

}

由于总场中小数点后的多个位置,因此在计算中产生问题.

我认为JSON序列化方法在内部转换但不知道如何解决这个问题

json objective-c ios

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

NSFont 和 UIFont 有什么区别

在搜索问题的解决方案时,我发现了NSFontUIFont

两者之间的基本区别是什么以及我们何时应该使用?

uifont ios nsfont

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

JSON Dictionary返回NSNumber的__NSCFNumber类

我使用下面的代码来获取数字运行时的类

 NSDecimalNumber* decimalNumber;

if ([paymentOrderDetail[@"Total"] class]==[NSNumber class]) {

decimalNumber = [NSDecimalNumber decimalNumberWithString:[paymentOrderDetail[@"Total"] stringValue]];

}else{

    decimalNumber = [NSDecimalNumber decimalNumberWithString:paymentOrderDetail[@"Total"]];
}
Run Code Online (Sandbox Code Playgroud)

如果条件总是失败,即使总数是一个数字不是字符串,当我打印总类时它给出"__NSCFNumber"

但我无法将其与"__NSCFNumber"进行比较

有什么办法可以让我知道整个对象的类类型

objective-c ios

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