我想根据不同国家/地区的本地格式显示日期.
我从这里得到了代码:获取用户的日期格式?(DMY,MDY,YMD)
NSString *base = @"MM/dd/yyyy";
NSLocale *locale = [NSLocale currentLocale];
NSString *format = [NSDateFormatter dateFormatFromTemplate:base options:0 locale:locale];
Run Code Online (Sandbox Code Playgroud)
但是我如何dd,mm,yyyy从格式中获取顺序?
我必须显示3个标签
LABEL1 | LABEL2 | LABEL3 //Horizontally
我希望这3个标签的宽度根据屏幕尺寸宽度平均分配
如何直接使用nib文件实现此目的?
谢谢
问题2
Label1 | Label2 | Lable3
//所有标签宽度相同
//所有标签都是视图调用X视图的子视图
Label1:身高是100
Label2:身高是150
Label3:身高是300
问:现在我希望X视图的高度为最大值(100,150,300)= 300
我实现了集合视图,我在其中显示文档目录中的图像.
但是由于图像从文档加载,集合视图不能平滑滚动.
如果图像从主束加载,那么它可以正常工作.
我的代码如下:
UIImageView *img=[[UIImageView alloc]init];
img.image=[UIImage imageWithContentsOfFile:[[arr_images objectAtIndex:indexPath.row]valueForKey:@"Image_path"]];
img.contentMode=UIViewContentModeScaleAspectFit;
cell.backgroundView=img;
Run Code Online (Sandbox Code Playgroud)
我应该使用线程吗?如果是的话,我该怎么做?我怎么解决这个?