메뉴 건너뛰기

app

[xcode] 스크롤뷰 사용하기

박영식2010.09.11 02:47조회 수 8115댓글 0

  • 2
    • 글자 크기
http://www.edumobile.org/iphone/iphone-programming-tutorials/scrollview-example-in-iphone/

위 사이트에서 설명을 볼수 있다.

터치폰에서 키보드 때문에 가려지는 view를 자동으로 위로 올려주는 기능이다

- (void) viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
                
        [[NSNotificationCenter defaultCenter] 
         addObserver:self
         selector:@selector
         (keyboardDidShow:) 
         name: UIKeyboardDidShowNotification
         object:nil];
        [[NSNotificationCenter defaultCenter]
         addObserver:self 
         selector:@selector
         (keyboardDidHide:) name:
         UIKeyboardDidHideNotification
         object:nil];
        
        scrollview.contentSize = CGSizeMake(SCROLLVIEW_CONTENT_WIDTH,
                                                                                SCROLLVIEW_CONTENT_HEIGHT);
       

        displayKeyboard = NO;
}


위 코드가 동작하지 않으면, viewDidLoad 에 옵저버를 등록해서 사용한다.

박영식 (비회원)
  • 2
    • 글자 크기
[xcode] 이미지 파일 업로드하기 (by 박영식) [xcode] tableview 사용하기 (by 박영식)

댓글 달기

박영식
2010.09.09 조회 4787
박영식
2010.05.25 조회 4090
박영식
2010.01.14 조회 4969
박영식
2009.09.21 조회 4146
박영식
2008.08.18 조회 6061
박영식
2008.08.17 조회 4192
박영식
2008.07.24 조회 4621
박영식
2008.07.23 조회 7998
박영식
2008.07.22 조회 3347
박영식
2008.04.11 조회 2198
박영식
2008.01.20 조회 2038
박영식
2007.12.23 조회 3222
첨부 (2)
scrollview.jpg
101.0KB / Download 84
ScrollViewExample.zip
714.3KB / Download 241
위로