首页 > 代码库 > ios openflow 自动布局及大小

ios openflow 自动布局及大小

环境:xcode5.1+ios7.1+openflow+ipad

说明:在view 添加openflow,xib是其他视图为自动布局;ipad横屏时 水平线未满屏;修改openflow的refreshCoverFlow方法如下:

  //设置openflow的大小

    AFOpenFlowView *coverFlowView = [[AFOpenFlowView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height-100)];         

    coverFlowView.translatesAutoresizingMaskIntoConstraints = NO;  //禁用自动布局
    NSDictionary *viewsbg = NSDictionaryOfVariableBindings(self.view,coverFlowView);
    [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-0-[coverFlowView]-0-|" options:0 metrics:0 views:viewsbg]];
    //    [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-0-[bgImage]-0-|" options:0 metrics:0 views:viewsbg]];
    [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-50-[coverFlowView]-50-|" options:0 metrics:0 views:viewsbg]];

  

ios openflow 自动布局及大小