Contents

?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
UIWebView의 딜리게이터 내용
- (void)webViewDidFinishLoad:(UIWebView*)webView {
    //현재 프로젝트의 리소스 파일의 경로 얻기.
    NSString *resourcePath = [[NSBundle mainBundle] resourcePath];

    // getImagePath와 같은 js파일 안의 메소드.
    NSString *tmpStr = [NSString stringWithFormat:@"getImagePath('%@')",
        resourcePath];

    // 문자열을 인코딩, 경로상에 공백과 같은 부분이 있을때 이를 해결.
    tmpStr = [tmpStr
        stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

    // 실행.
    [webView stringByEvaluatingJavaScriptFromString:tmpStr];
}

JS 파일 내용
function getImagePath( _imgPath ) {
    //앞에서 넘겨 받은 경로뒤에 원하는 이미지명을 입력.
     addCSSRule('.highlight_color1',
        'background-image: url('+ _imgPath +'/bg_highlightpen_1.png);');
}


[출처] http://egloos.zum.com/sungsmy/v/2428366


?

List of Articles
No. Category Subject Author Date Views
313 Develop [js] 여러가지 트리(tree) 모음.. ㅋㅋ file hooni 2013.04.23 7120
312 Develop [ajax] 이벤트 코드 생성기 작업중.. ㅋㅋ file hooni 2013.04.23 7120
311 Develop [c] 문자열 뒤집기 초간단 샘플 코드 ㅎㅎ hooni 2013.04.23 7119
310 Develop [php] 현재에서 일정한 날짜 더하기.. hooni 2013.04.23 7114
309 Develop [c++] 인라인 함수에 대한 설명 hooni 2013.04.23 7110
308 Develop [pdf] 포인터 문법 정리 (C pointer) file hooni 2013.04.23 7108
307 Develop [c] 테트리스3D (Tetris 3D) file hooni 2013.04.23 7107
306 Develop [c] 베이지언(Bayesian) 패턴인식 과제 ㅋㅋ file hooni 2013.04.23 7096
305 Develop [c] 단기과정[01/14] 피보나치, 파스칼.. 파일입출력 file hooni 2003.04.23 7081
304 Develop [js] 2차 잉여.. (Quadratic reciprocity) 계산.. file hooni 2013.04.23 7077
303 Develop [asp] 기본 문법과 제어문 hooni 2013.04.23 7076
302 Develop [c] 구조체/파일 입출력 프로그램 file hooni 2003.04.23 7063
Board Pagination Prev 1 ... 40 41 42 43 44 45 46 47 48 49 ... 71 Next
/ 71