티스토리 뷰
퍼미션 설정
테마 변경 설정
1. 상단 bar 없는 테마로 변경
2. RelativeLayout 의 padding 없애기
3. manifast.xml 퍼미션 설정
Main Activity
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView webview = (WebView) findViewById(R.id.webView);
//webview.setWebViewClient(new WebViewClient()); //기본 브라우저 사용
webview.setWebChromeClient(new WebChromeClient()); // 크롬 브라우저 사용
WebSettings webSettings = webview.getSettings();//getSettings 사용
webSettings.setSupportZoom(true); //줌 사용
webSettings.setBuiltInZoomControls(true);
webSettings.setDisplayZoomControls(true);
webSettings.setJavaScriptEnabled(true); //자바스크립트 실행
webview.loadUrl("https://google.co.kr");
}//onCreate
} //class
AndroidManifast.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hyangmok.android.webview">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
'ANDROID > android' 카테고리의 다른 글
Lambda 식 사용설정 (0) | 2016.09.30 |
---|---|
[Layout] Progress Bar (0) | 2016.09.27 |
broadcast send/reciver (0) | 2016.09.23 |
버튼 그림자 없애기 (0) | 2016.09.23 |
메인화면 추가생성 방지 (0) | 2016.09.20 |
Comments