Contents

조회 수 981 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
로컬에 있는 html 파일을 불러오는 방법!!
일단 웹뷰에서 보고자하는 html 파일을 프로젝트에 추가.
아래와 같은 코드로 로컬에 있는 html 파일을 읽어와서 웹뷰에 내용을 출력할 수 있다.
UIWebView *webView = [[UIWebView alloc]
    initWithFrame:CGRectMake(x, y, width, height)];

NSString *htmlFile = [[NSBundle mainBundle]
    pathForResource:@"파일명" ofType:@"html"];

NSData *htmlData = [NSData dataWithContentsOfFile:htmlFile];

[webView loadData:htmlData MIMEType:@"text/html"
    textEncodingName:@"UTF-8" baseURL:[NSURLURLWithString:@""]];

[self.view addSubview:webView];

-----------
팁!
webView에 라운드 주는 방법!
QuartzCore 프레임워크를 임포트하고 라운드 속성을 넣어준다.
#import <QuartzCore/QuartzCore.h>

[[webView layer] setCornerRadius:10];
[webView setClipsToBounds:YES];

[[webView layer]setBorderColor:
[[UIColor colorWithRed:0.52 green:0.09 blue:0.07 alpha:1] CGColor]];
[[webView layer] setBorderWidth:2.75];

[출처] http://bananamilk.tistory.com/197

?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
357 Develop [linux] 날짜나 파일의 내용으로 검색하는 방법(find 명령 사용) hooni 2013.04.23 8161
356 System/OS [linux] 네트워크 커널 설정.. hooni 2003.04.23 16558
355 System/OS [linux] 네트웍 트래픽 모니터링(MRTG) hooni 2003.04.23 42490
354 System/OS [linux] 데비안(debian.org) 리눅스 명령어 예제 hooni 2006.04.23 10518
353 System/OS [linux] 데스크탑환경(GNOME/KDE) 바꾸기.. hooni 2003.04.23 12213
352 System/OS [linux] 랜카드 2개 설정 & iptables 로 사설 ip.. hooni 2003.04.23 14786
351 System/OS [linux] 랜카드가 2개 일 때 네트워크 설정 hooni 2003.04.23 30139
350 System/OS [linux] 리눅스 파일시스템과 디렉토리 설명 hooni 2013.04.23 26941
349 System/OS [linux] 리눅스 활용 팁^^ hooni 2003.04.23 14692
348 System/OS [linux] 리눅스, 유닉스 CPU 이용률 확인.. hooni 2013.04.23 23861
347 System/OS [linux] 리눅스,유닉스 /proc/stat 파일 보는 법 hooni 2013.04.23 18026
346 System/OS [linux] 메일서버 세팅정보(sendmail) hooni 2003.04.23 17483
Board Pagination Prev 1 ... 64 65 66 67 68 69 70 71 72 73 ... 98 Next
/ 98