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

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

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. DNS 网关 子网掩码介绍

    DNS DNS(Domain Name System,域名系统),因特网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网,而不用去记住能够被机器直接读取的IP数串.通过主机 ...

  2. JQuery中点击超链接动态修改url连接地址无效

    这篇随笔的标题真是好拗口,想表达的意思是,当点击超链接后,才去修改超链接的地址,此时超链接仍然链接的是是修改之前的页面,而不是修改之后的页面. 超链接代码如下: <a id="chao ...

  3. HDU 4280 Island Transport

    Island Transport Time Limit: 10000ms Memory Limit: 65536KB This problem will be judged on HDU. Origi ...

  4. [uiautomator篇][11]wifi

    package com.softwinner.network.wifi; import android.content.Context; import android.content.Intent; ...

  5. [automator学习篇]android 接口-- bluetooth

    http://www.android-doc.com/guide/topics/connectivity/bluetooth.html 本地下载的sdk 目录:     D:\AndroidSdk\s ...

  6. 学习iis工作原理

    文章:IIs工作原理 文章:Asp.Net 构架(Http Handler 介绍) - Part.2

  7. PTA 07-图6 旅游规划 (25分)

    题目地址 https://pta.patest.cn/pta/test/15/exam/4/question/717 5-9 旅游规划   (25分) 有了一张自驾旅游路线图,你会知道城市间的高速公路 ...

  8. 每天一个linux命令目录(转)

    一. 文件目录操作命令: 1.每天一个linux命令(1):ls命令 2.每天一个linux命令(2):cd命令  3.每天一个linux命令(3):pwd命令 4.每天一个linux命令(4):mk ...

  9. mac安装R语言启动后-Warning messages

    During startup - Warning messages: : Setting LC_CTYPE failed, using "C" : Setting LC_COLLA ...

  10. Mahout0.9安装与配置(完全分布式模式下运行)

    安装Mahout之前,一定要把hadoop装好,hadoop的安装方法可以参考我的前一篇随笔,我安装的是hadoop2.7.0,具体方法在此不做介绍. 1.首先下载相应版本的Mahout: axel ...