2011-12-22 7 views
5

나는 webview를 확장하는 클래스 (MyCustomWebView)를 가지고 있는데, 이렇게 할 수 있을까?Android에서 맞춤 웹 뷰를 만드는 방법은 무엇입니까?

<MyCustomWebView 
    android:id="@+id/myCustomWebView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
/> 

그렇지 않은 경우 이럴 수 있습니다.

WebView webView = (WebView) findViewById(R.id.webview); 
webView = new MyCustomWebView(this); 

답변

15

예, 당신은이 작업을 수행 할 수 있습니다

MyCustomWebView myWebView = (MyCustomWebView) findViewById(R.id.myCustomWebView); 
:

<your.package.MyCustomWebView android:id="@+id/myCustomWebView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    /> 

그런 다음 코드에서이 작업을 수행 할 수 있습니다

관련 문제