Contents

?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
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
번호 분류 제목 글쓴이 날짜 조회 수
33 Develop macOS에 node, npm 설치하기 (homebrew) file hooni 2021.11.06 1149
32 Develop Mac OS 에 Jenkins 설치하기 (Homebrew) 2 file hooni 2017.03.15 8123
31 System/OS Mac OS X - Apache+PHP+MySQL 환경 서버 hooni 2013.04.25 31629
30 Develop Laravel 5 Failed opening required bootstrap/../vendor/autoload.php hooni 2018.01.24 1662
29 Develop JSON, BSON 변환 file hooni 2013.04.23 11814
28 Etc IT감사 기법 시험 file hooni 2017.06.14 1423
27 Etc ISMS 인증기준 – 정보보호대책 (시스템개발보안) file hooni 2016.12.01 1328
26 System/OS iptime 공유기 해킹 기술문서 4 file hooni 2015.01.01 1941
25 Etc IPR 특허 관련 secret hooni 2015.04.28 0
24 Etc IoT가 만드는 미래와 플랫폼 경쟁력 secret hooni 2014.09.23 0
23 Etc iOS 에서 쓸만한 오프라인 구글지도 찾기 hooni 2014.01.06 16039
22 System/OS HTTPS와 SSL 인증서 file hooni 2014.03.11 7548
Board Pagination Prev 1 ... 89 90 91 92 93 94 95 96 97 98 Next
/ 98