您的位置:首页 > 产品设计 > UI/UE

【ios 汇总 - UI 视图布局 】

2014-01-25 01:08 441 查看


iOS 各种控件默认高度(图示)

http://blog.csdn.net/tongzhitao/article/details/8569279



UIButton上使用UIEdgeInsetsMaketitle 跟图片对齐 

http://blog.csdn.net/yanxiaoqing/article/details/7230660

contentSize、contentInset和contentOffset区别 

http://blog.csdn.net/kylinbl/article/details/7043936

UIView层次管理 放到最上层 放到最下层

将一个UIView显示在最前面只需要调用其父视图的 bringSubviewToFront()方法。

将一个UIView层推送到背后只需要调用其父视图的 sendSubviewToBack()方法。

遍历window的所有子视图

    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;

            }

        }

一些效果

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结构详解

(侧重于文档分析)

http://blog.csdn.net/likendsl/article/details/7620726

遍历方法

通过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];

添加子UIView

可以设置 clipsToBounds 属性, 确保子视图不超出上级视图的范围
clipsToBounds  默认是NO

设置的坐标是 子视图相对 上级的坐标,所以还可以是负值

UITabBarController

 hidesBottomBarWhenPushed   来确认子视图是否显示 下面的tabbar 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios 布局 ui uiview ios SDK