메뉴 건너뛰기

app

[xcode] 스크롤뷰 사용하기

박영식2010.09.11 02:47조회 수 7944댓글 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
    • 글자 크기

댓글 달기

박영식
2006.09.01 조회 1412
lispro06
2015.05.15 조회 1453
lispro06
2015.05.15 조회 1467
lispro06
2015.11.20 조회 1471
lispro06
2013.12.11 조회 1484
suritam9
2013.11.26 조회 1490
lispro06
2016.11.02 조회 1566
lispro06
2014.08.16 조회 1568
lispro06
2017.07.16 조회 1593
이전 1 2 3 4 5 6 7 8 9 10... 14다음
첨부 (2)
scrollview.jpg
101.0KB / Download 69
ScrollViewExample.zip
714.3KB / Download 223
위로