下午写写了个小东西小界面

有须要的能够直接拿过来用 ,简洁,挺好看,自我感觉;

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMDEyMzIwOA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMDEyMzIwOA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

写界面事实上就是自上而下的在view加空间,注意一下位置即可了

- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
CGRect screenSize = [[UIScreen mainScreen]bounds]; //无货物信息图片
UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 160, 100)];
image.center = CGPointMake(screenSize.size.width/2,screenSize.size.height/2-15-55);
image.image = [UIImage imageNamed:@"nocargo.jpg"];
image.backgroundColor = [UIColor orangeColor];
[self addSubview:image]; //你还没有收货地址label
UILabel *noLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 160, 30)];
noLabel.center =CGPointMake(screenSize.size.width/2,screenSize.size.height/2 );
noLabel.text = @"您还没有收获地址";
noLabel.textAlignment = NSTextAlignmentCenter;
noLabel.font = [UIFont fontWithName:@"Helvetica" size:19];
[self addSubview:noLabel]; //请加入新地址label
UILabel *addLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 150, 30)];
addLabel.center =CGPointMake(screenSize.size.width/2,screenSize.size.height/2+30);
addLabel.text = @"请加入新地址";
addLabel.textAlignment = NSTextAlignmentCenter;
addLabel.font = [UIFont fontWithName:@"Helvetica" size:15];
[self addSubview:addLabel]; //加入新地址button设置
addAddressBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 150, 30)];
addAddressBtn.center = CGPointMake(screenSize.size.width/2,screenSize.size.height-40 );
[addAddressBtn setTitle:@"加入新地址" forState:UIControlStateNormal];
[addAddressBtn addTarget:self action:@selector(addAddressBtnClick) forControlEvents:UIControlEventTouchDown];
addAddressBtn.layer.borderWidth = 1;
addAddressBtn.layer.cornerRadius = 5;
addAddressBtn.layer.borderColor = [UIColor redColor].CGColor;
addAddressBtn.titleLabel.font = [UIFont fontWithName:@"Helvetica" size:18];
addAddressBtn.titleLabel.textColor = [UIColor redColor];
[self addSubview:addAddressBtn]; self.backgroundColor = [UIColor colorWithRed:238/255.0 green:238/255.0 blue:238/255.0 alpha:1]; ;
}
return self;
}

以上就是第一个页面的全部内容;

我们来看一下第二张图吧

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMDEyMzIwOA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

xib 中加入控件实现这个效果三个都是label。设置一下字体什么的即可 最后加一个小图片 箭头

注意在地址中我们用到了富文本label 将【默认】设置为红色。看第二幅图。

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Using NSAttributed String"];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor blueColor] range:NSMakeRange(0,5)];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(6,12)];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:NSMakeRange(19,6)];
[str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Arial-BoldItalicMT" size:30.0] range:NSMakeRange(0, 5)];
[str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:30.0] range:NSMakeRange(6, 12)];
[str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Courier-BoldOblique" size:30.0] range:NSMakeRange(19, 6)];
attrLabel.attributedText = str;

本段代码来自http://www.cnblogs.com/taintain1984/p/3550525.html;

以下是在设置tablecell的代码。

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"cellIdentifier";
NSDictionary *dictionary = [tableArray objectAtIndex:indexPath.row];
TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(cell==nil)
{
cell = [[NSBundle mainBundle] loadNibNamed:@"TableViewCell" owner:nil options:nil][0];
}
cell = [cell setCelldictionary:dictionary];
return cell;
}

最后有一个地方就是我们写完tableview的时候是第三幅图的样子,后面没有内容了可是还是有表格线,那我们怎么办呢。

仅仅要加上一句话就够了

self.tableFooterView = [[UIView alloc]init];

self 是tableview。

其它的就没什么了,主要是为了帮忙,写了两个界面。记录一下不熟练的地方。

界面代码下载地址:http://download.csdn.net/detail/u010123208/8013673

简洁的ios小界面的更多相关文章

  1. 如何让iOS 保持界面流畅?这些技巧你知道吗

    如何让iOS 保持界面流畅?这些技巧你知道吗   作者:ibireme这篇文章会非常详细的分析 iOS 界面构建中的各种性能问题以及对应的解决思路,同时给出一个开源的微博列表实现,通过实际的代码展示如 ...

  2. 【转】iOS保持界面流畅的技巧

    原文链接:iOS保持界面流畅的技巧 这篇文章会非常详细的分析 iOS 界面构建中的各种性能问题以及对应的解决思路,同时给出一个开源的微博列表实现,通过实际的代码展示如何构建流畅的交互. Index演示 ...

  3. fir.im Weekly - iOS 保持界面流畅的技巧

    生命不息,coding 不止.本期 fir.im Weekly 收集了微博上的热转资源,包含 Android.iOS 开发工具.源码分享,产品 UI 设计的好文章,还有一些程序员成长的 Tips,希望 ...

  4. iOS 8 界面设计 PSD 模板(iPhone 6),免费下载

    在 iOS 8 发布不久,Teehan & Lax 就发布了 iOS 8(iPhone6)用户界面的 PSD 模板.该网站分享众多 PSD 模板素材,这些精美的 PSD 界面模板在制作界面原型 ...

  5. IOS小工具以及精彩的博客

    IOS小工具以及精彩的博客 工具 Log Guru是一个收集Log的小工具, 可以在 Mac 上查看 iOS 设备的实时系统日志. 现在可以直接高亮显示在 FIR.im 上安装 app 失败的原因.后 ...

  6. Sprint 2 : ios图形界面设计与代码整合

    这周我们主要focus在personal photo experience 项目的ios图形界面设计与代码整合工作上. 工作进度: 1. 图形界面设计方面:兆阳和敏龙基本已经将ios手机客户端的雏形界 ...

  7. IOS小组件(6):小组件实现时钟按秒刷新

    引言   上一节中我们了解了IOS小组件的刷新机制,发现根本没法实现按秒刷新,但是看别的App里面有做到,以为用了什么黑科技,原来是因为系统提供了一个额外的机制实现时间的动态更新,不用走小组件的刷新机 ...

  8. iOS Block界面反向传值小demo

    1.在第二个视图控制器的.h文件中定义声明Block属性: // 定义block @property (nonatomic, copy) void (^NextViewControllerBlock) ...

  9. iOS 小知识点(持续更新)

    1.如何通过代码设置Button  title的字体大小 设置Button.titleLabel.font = [UIFont systemFontOfSize:<#(CGFloat)#> ...

随机推荐

  1. 对linux中source,fork,exec的理解以及case的 使用

    fork   使用 fork 方式运行 script 时, 就是让 shell(parent process) 产生一个 child process 去执行该 script, 当 child proc ...

  2. LeetCode(116) Populating Next Right Pointers in Each Node

    题目 Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode * ...

  3. poj 3783

    Balls Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1196   Accepted: 783 Description ...

  4. adb 常用命令详解

    1.把电脑上文件或目录copy到手机中:adb push <local> <remote>    - copy file/dir to device 此处的<local& ...

  5. mysql复制延迟排查

    今天收到报警,提示从库延时,首先当然是上去查看情况,首先查看机器负载,如下: 可以看到使用cpu已经100%,io没有等待.那么查看mysql是什么情况,执行show processlist没有发现任 ...

  6. Python 多级目录选择+一键正反排序

    效果如图所示,可以根据条件来选择对象 cat pc.py #!/usr/bin/pythonfrom flask import Flask,render_template,request,redire ...

  7. python基础-对象

    1. 对象:一组数据和操作数据方法的集合 >>> class Person(object): ...     def __init__(self,name): ...         ...

  8. Codeforces Round #305 (Div. 2) D. Mike and Feet

    D. Mike and Feet time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

  9. 奇奇怪怪的冒泡排序 TOJ 2014: Scramble Sort

    粘贴两个特别简单的冒泡排序 2014: Scramble Sort Description In this problem you will be given a series of lists co ...

  10. BZOJ 3856: Monster【杂题】

    Description Teacher Mai has a kingdom. A monster has invaded this kingdom, and Teacher Mai wants to ...