ios gradient background after constraint applied
<p>I have a xib file which has a contain one uiview and 3 uibutton. flush-seamed spaced.(uiview 2px space uibuttun 2px space ...)</p>

<p>I apply constraints in xib files and they are automatically right place if device ipad,iphone or landscape or portrait first launching. They are getting bigger or smaller according to device.
the problem start when i apply gradient to buttons.</p>

<pre><code>CAGradientLayer *gradientMain = [CAGradientLayer layer];
gradientMain.frame = myview.frame; //myview.bounds no matter
gradientMain.colors = [NSArray arrayWithObjects:(id)[[UIColor colorWithRed:(65/255.0) green:(64/255.0) blue:(66/255.0) alpha:1.0] CGColor], (id)[[UIColor colorWithRed:(35/255.0)  green:(31/255.0)  blue:(32/255.0)  alpha:1.0] CGColor], nil];
[myview.layer insertSublayer:gradientMain atIndex:0];
</code></pre>

<p>afterthis code, when i change orientation of device bounds in xib file sizes and views are conflicting. How can i achive this problem.</p>

<p>İ try to these after orientation, but not work</p>

<pre><code>[self.centerCollectionView reloadData];
</code></pre>