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 [asp] 폼메일 예제와 메일 포워딩 프로그램 file hooni 2013.04.23 7158
312 Develop [c] 바로 보고 정리할 것.. ㅋㄷㅋㄷ file hooni 2013.04.23 7152
311 Develop [c] 달팽이 배열? 인지 먼지.. ㅋㅋ hooni 2013.04.23 7151
310 Develop [pdf] 포인터 문법 정리 (C pointer) file hooni 2013.04.23 7145
309 Develop [js] 여러가지 트리(tree) 모음.. ㅋㅋ file hooni 2013.04.23 7137
308 Develop [c] 문자열 뒤집기 초간단 샘플 코드 ㅎㅎ hooni 2013.04.23 7136
307 Develop [c++] 인라인 함수에 대한 설명 hooni 2013.04.23 7130
306 Develop [php] 초간단 웹 카운터.. file hooni 2003.04.23 7128
305 Develop [c] 베이지언(Bayesian) 패턴인식 과제 ㅋㅋ file hooni 2013.04.23 7117
304 Develop [c] 테트리스3D (Tetris 3D) file hooni 2013.04.23 7116
303 Develop [c] 단기과정[01/14] 피보나치, 파스칼.. 파일입출력 file hooni 2003.04.23 7115
302 Develop [js] 2차 잉여.. (Quadratic reciprocity) 계산.. file hooni 2013.04.23 7098
Board Pagination Prev 1 ... 40 41 42 43 44 45 46 47 48 49 ... 71 Next
/ 71