Reputation:
hi i have coded in applicationdidfinish method as
[m_tabViewController view].frame = CGRectMake(0,15, 768, 90);
[m_tabViewController view].center = CGPointMake(670, 0);
[m_tabViewController view].transform = CGAffineTransformMakeRotation(degreesToRadians(315));
[window addSubview:viewController.view];
[window addSubview:[m_tabViewController view]];
[window makeKeyAndVisible];
but after rotation , the width and height of that [m_tabViewController view] is changed(very samll size)..please give solution...center is not working also...
Upvotes: 0
Views: 500
Reputation: 2672
As a first point, this looks odd:
[m_tabViewController view].center = CGPointMake(670, 0);
I would have thought that the center would have been:
x = (0 + 768) / 2 = 384
y = (15 + 90) / 2 = 52.5
So I expect the center to be:
[m_tabViewController view].center = CGPointMake(384, 52.5);
Also, as a second point, the following has me curious.
[window addSubview:viewController.view];
[window addSubview:[m_tabViewController view]];
As I'm not really sure if this is your intent. Did you really mean?
[window addSubview:viewController.view];
[viewController.view addSubview:[m_tabViewController view]];
(But that last point is a wild guess.)
Upvotes: 0