ReactiveCocoaLayout icon indicating copy to clipboard operation
ReactiveCocoaLayout copied to clipboard

when I set rcl_top , why the height and width changed ?

Open kaich opened this issue 10 years ago • 1 comments

I write code as below :

self.ivIcon=[[UIImageView alloc] initWithFrame:CGRectMake(20, 20, 80, 80)];
[self.view addSubview:self.ivIcon];
self.lblTitle=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 12)];
[self.view addSubview:self.lblTitle];
RCLAlignment(self.lblTitle)=@{
                              rcl_top: self.ivIcon.rcl_frameSignal.top,
                              };

I get the self.lblTitle frame = (0 20; 60 18). I don't know why the Height and Width changed. Could you tell me the reason. I am newer to ReactiveCocoa and The Framework. I try to debug find the reason. But I find It's so hard to find a useful information about it . And what's the difference between RCLAlignment and RCLFrame. I can't understand it. Hope your anwer, thanks

kaich avatar May 30 '14 07:05 kaich

I don't know why the Height and Width changed.

Any components that are unspecified with RCLAlignment or RCLFrame will use the view's intrinsicContentSize.

And what's the difference between RCLAlignment and RCLFrame.

The former corresponds to -[UIView alignmentRectForFrame:], and the latter corresponds to UIView.frame.

jspahrsummers avatar Jun 09 '14 21:06 jspahrsummers