Contents

조회 수 964 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
781 Develop [c] 가위 바위 보 서버, 클라이언트 소스코드 file hooni 2003.04.23 8206
780 Develop [c] fork() 시스템 콜 사용 방법. hooni 2003.04.23 27630
779 Develop [c] 소켓 프로그래밍 요약.. hooni 2003.04.23 6986
778 Develop [c] 소켓주소 구조체에 대해.. hooni 2003.04.23 6752
777 Develop [c] 소켓의 세가지 동작모드 hooni 2003.04.23 6934
776 Develop [c] 컴파일러 DFA구현^^ 입력 받아 실행 4 file hooni 2003.04.23 8132
775 Develop [c] OpenGL 시어핀스키 가스킷(p.73 - 첫시간) hooni 2003.04.23 8769
774 Develop [c] 시어핀스키 가스킷..(p.582, A.2 - 두번째) hooni 2003.04.23 7518
773 Develop [c] 약수/최대공약수/완전수 알고리즘 hooni 2003.04.23 8889
772 Develop [c] 프로그래밍의 전반적인 설명 ppt file hooni 2003.04.23 7696
771 Develop [jsp] HelloServlet 출력문 file hooni 2003.04.23 7830
770 Develop [jsp] Get방식, Post방식 전송 예제.. file hooni 2003.04.23 13786
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 71 Next
/ 71