为uitableview创建边框 [英] creating border for uitableview

查看:85
本文介绍了为uitableview创建边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在uiview中使用了uitableview和scrollview。如何为table或scrollview设置边框?

I am using a uitableview and scrollview in a uiview. How to set a border for table or scrollview?

推荐答案

#import  "QuartzCore/QuartzCore.h"

然后在 viewDidLoad 使用,

tableView.layer.borderWidth = 2.0;

注意

你也可以设置边框颜色:

You can also set the border color:

tableView.layer.borderColor = [UIColor redColor].CGColor;

它应该适合你。 :)

这篇关于为uitableview创建边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆