UIButton上使用UIEdgeInsetsMaketitle 跟图片对齐
http://blog.csdn.net/yanxiaoqing/article/details/7230660
contentSize、contentInset和contentOffset区别
UIView层次管理 放到最上层 放到最下层
将一个UIView显示在最前面只需要调用其父视图的 bringSubviewToFront()方法。
将一个UIView层推送到背后只需要调用其父视图的 sendSubviewToBack()方法。
将一个UIView层推送到背后只需要调用其父视图的 sendSubviewToBack()方法。
遍历window的所有子视图
for (UIView *view inself.window.subviews) {
if ([view isKindOfClass:[QzoneInternalGuideclass]]) {
[self.windowbringSubviewToFront:view];
break;
}
}
for (UIView *view inself.window.subviews) {
if ([view isKindOfClass:[QzoneInternalGuideclass]]) {
[self.windowbringSubviewToFront:view];
break;
}
}
遍历controller
NSArray *viewControllers = self.navigationController.viewControllers;
for (int i = [viewControllers count] - 1; i >= 0; --i)
{
UIViewController *controller = [viewControllers objectAtIndex:i];
if ([controller isKindOfClass:NSClassFromString(@"QZShareAlbumsFeedListController")])
{
((QZShareAlbumsFeedListController *)controller).albumTitleName = cirInfo.shareAlbumsName;
((QZShareAlbumsFeedListController *)controller).title = cirInfo.shareAlbumsName;
break;
}
}
for (int i = [viewControllers count] - 1; i >= 0; --i)
{
UIViewController *controller = [viewControllers objectAtIndex:i];
if ([controller isKindOfClass:NSClassFromString(@"QZShareAlbumsFeedListController")])
{
((QZShareAlbumsFeedListController *)controller).albumTitleName = cirInfo.shareAlbumsName;
((QZShareAlbumsFeedListController *)controller).title = cirInfo.shareAlbumsName;
break;
}
}
一些效果
1.添加阴影
self.layer.shadowOffset = CGSizeMake(-5, 3);
self.layer.shadowOpacity = 0.4;
self.layer.shadowColor = [UIColor blackColor].CGColor;
2.添加圆角
btn. layer . cornerRadius = 8 ;btn.layer.masksToBounds = YES;//使用边界来做遮罩
设置密文
[self.originalPwd setSecureTextEntry:YES];
视图之UITabBarController结构详解
遍历方法
通过
viewWithTag
来找到子view
UIButton * button = (UIButton *)[self.menu viewWithTag:buttonTag]
IOS设计UI工具大全
http://blog.csdn.net/weiwangchao_/article/details/7606754
画分割线
UIView
* line = [[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
, containerViewFrame.
origin
.
y
+containerViewFrame.
size
.
height
+
40
,
320
,
1
)];
line. backgroundColor = [ UIColor colorWithRed : 0xD9 / 255.0f green : 0xD9 / 255.0f blue : 0xD9 / 255.0f alpha : 1 ];
[ self addSubview :line];
line. backgroundColor = [ UIColor colorWithRed : 0xD9 / 255.0f green : 0xD9 / 255.0f blue : 0xD9 / 255.0f alpha : 1 ];
[ self addSubview :line];
添加子UIView
可以设置 clipsToBounds 属性, 确保子视图不超出上级视图的范围
clipsToBounds 默认是NO
设置的坐标是 子视图相对 上级的坐标,所以还可以是负值
UITabBarController
hidesBottomBarWhenPushed 来确认子视图是否显示 下面的tabbar