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
번호 분류 제목 글쓴이 날짜 조회 수
697 Develop [c++] 인라인 함수 설명과 예제.. file hooni 2013.04.23 6633
696 Develop [c++] 인라인 함수에 대한 설명 hooni 2013.04.23 7110
695 Develop [c++] 자료구조(링크리스트,스택,큐)와 후위 표기 계산기 샘플 ㅋㅋ 4 file hooni 2013.04.23 12327
694 Develop [c++] 중복실행 방지(Mutex;뮤텍스 ) 샘플 소스.. ㅋㅋ file hooni 2013.04.23 8743
693 Develop [c++] 채팅로봇 소스.. ㅋㄷㅋㄷ file hooni 2013.04.23 8880
692 Develop [c++] 초간단 스택 두 가지 방식(class, struct) file hooni 2013.04.23 7556
691 Develop [c++] 템플릿(Template) 예제 소스.. file hooni 2013.04.23 6982
690 Develop [c++] 트리컨트롤 스텝 2 예제.. file hooni 2013.04.23 6959
689 Develop [c++] 트리컨트롤 스텝 3 예제.. file hooni 2013.04.23 7949
688 Develop [c++] 트리컨트롤 예제1 ㅋㅋ file hooni 2013.04.23 7175
687 Develop [c++] 퍼즐 버블버블 간단한 원리(사용공식) file hooni 2013.04.23 9960
686 Develop [c++] 프리렉(freelec) 예제 자료.. ㅋㄷ file hooni 2013.04.23 6839
Board Pagination Prev 1 ... 8 9 10 11 12 13 14 15 16 17 ... 71 Next
/ 71