2013-05-01 64 views
1

的結構是這樣的,..添加一個UIView的到子視圖這已經加入的MainView

*)的MainView

 1) viewLocations(UIVIEW) // this one is adding fine 

      a) viewBangalore 
      b) viewHyderbad 

其實我在做一個iPad應用程序,在UIViewController之一中,我使用UiTableController作爲滑動視圖來選擇位置。根據位置選擇,需要顯示UiView的。

enter image description here

viewLocations - > CGRectMake(0108588533)

這裏我的代碼是:

if (_detailItem) { 
     Location=[_detailItem description]; 

     if ([Location isEqual:@"Bangalore"]) { 
      self.viewLocBangalore= [[UIView alloc] initWithFrame:CGRectMake(10, 10, 500, 400)]; 
      // self.viewLocBangalore.frame = CGRectMake(10, 10, 500, 400); 
      [self.viewLocations addSubview:self.viewLocBangalore]; 

      [UIView transitionFromView:self.viewLocHyderbad 
           toView:self.viewLocBangalore 
           duration:0.9 
           options:UIViewAnimationOptionTransitionFlipFromBottom 

          completion:^(BOOL finished) { 
           NSLog(@"Locations View Appeared %@", Location); 
          }]; 

     } 

     else if ([Location isEqual:@"Hyderbad"]) 
     { 
      self.viewLocHyderbad.frame = CGRectMake(10, 10, 600, 519); 
      [self.viewLocHyderbad removeFromSuperview]; 
      [self.ViewLocations addSubview:self.viewLocHyderbad]; 

      [UIView transitionFromView:self.viewLocBangalore 
           toView:self.viewLocHyderbad 
           duration:0.9 
           options:UIViewAnimationOptionTransitionFlipFromBottom 

          completion:^(BOOL finished) { 
           NSLog(@"Locations View Appeared %@", Location); // getting this Log also, but View is missing 
          }]; 

     } 




    } 

到目前爲止,我已經盡力了,我din't得到它的解決方案。這裏究竟發生了什麼..? 謝謝。

+0

檢查視圖的背景顏色? – Balu 2013-05-01 12:34:25

+0

@Sunny我也試過,也.. – 2013-05-01 12:42:57

+0

你確定self.viewLocations連接(而不是無)? – 2013-05-01 12:47:05

回答

1

可能是一些其他視圖重疊該視圖,但我不確定嘗試使用此方法。

[self.ViewLocations bringSubviewToFront:viewname]; 
+0

感謝您的回答,但沒有發生。 – 2013-05-01 12:33:04

相關問題