2013-08-30 6 views
0

UIScrollView의 위치에 문제가 있습니다. tableview에는 몇 가지 항목이 있으며 각 항목에 detailview가 있습니다. 앱을 열면 tableview가 표시되고 항목을 선택하면 detailview에 scrollview가 생깁니다. 문제는 그것이 어디에 있어야 하는지를 보여주지 않는다는 것입니다. 보기에서 더 낮게 나타납니다. 또한 보이지 않는 아래쪽에 작은 메뉴가 있습니다. 하지만 다른 뷰와 함께 내 tableview가있는 앱의 기본 메뉴에 액세스 한 다음 tableview로 이동하여 항목을 탭하면 detailview의 scrollview가 올바른 위치에 있고 메뉴가 표시됩니다. 하단이 표시됩니다. 이것이 일어나는 이유는 무엇입니까? 여기에 첫 번째 잘못된 위치에 이미지와뷰에서 UIScrollView 위치 지정?

: 나는 내가 무슨 말을하는지보기 위해 두 개의 이미지를 부착하고있어 위치

http://imageshack.us/a/img689/3834/t5ek.png

하고있는 ScrollView와 두 번째 메뉴는 어디 해야한다. 그 내용을 변경 안에 내가 UITextView를 사용하고 있기 때문에

http://img547.imageshack.us/img547/2876/oje2.png

있는 ScrollView의 크기는 동적입니다.

- (void)configureScrollView{ 

CGRect textViewFrame = self.ingredientsTextView.frame; 
textViewFrame.size = [self.ingredientsTextView contentSize]; 
self.ingredientsTextView.frame = textViewFrame; 

CGRect contentViewFrame = self.contentView.frame; 
contentViewFrame.size.height = textViewFrame.origin.y+textViewFrame.size.height+10.0f; 
self.contentView.frame = contentViewFrame; 

[self.scrollView setContentSize:contentViewFrame.size]; 

self.ingredientsTextView.editable=NO; 
self.ingredientsTextView.scrollEnabled=NO; 

//enable zoomIn 
self.scrollView.delegate=self; 
self.scrollView.minimumZoomScale=1; 
self.scrollView.maximumZoomScale=7; 

}

답변

0

viewdidAppear에서 "configureScrollView"메소드를 호출하십시오.

+0

같은 결과가 표시됩니다. – devC

관련 문제