本文整理汇总了Java中android.webkit.WebView.setScrollBarStyle方法的典型用法代码示例。如果您正苦于以下问题:Java WebView.setScrollBarStyle方法的具体用法?Java WebView.setScrollBarStyle怎么用?Java WebView.setScrollBarStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.webkit.WebView
的用法示例。
在下文中一共展示了WebView.setScrollBarStyle方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
/**
* Called when the activity is first created. Set the web view layout and
* get the title and file to be displayed.
*
* @param savedInstanceState
* Is used to save the state of the created Activity.
*
* @author Yuriy Stanchev
*
* @email [email protected]
*
* @date 11 Mar 2012
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
Bundle extras = intent.getExtras();
String title = (String) extras.get("title");
String file = (String) extras.get("file");
setContentView(R.layout.about);
setTitle(title);
WebView view = (WebView) findViewById(R.id.web);
view.setFocusable(true);
view.setFocusableInTouchMode(true);
view.requestFocus();
view.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
view.loadUrl(file);
}
示例2: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_area_do_participante);
setSupportActionBar((Toolbar) findViewById(R.id.toolbarWV));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Set title of Detail page
areaParticipante = (WebView) findViewById(R.id.areaParticipante);
areaParticipante.setWebViewClient(new MyBrowser());
areaParticipante.getSettings().setJavaScriptEnabled(true);
areaParticipante.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
areaParticipante.loadUrl(NetworkUtils.BASE_URL+"area-do-participante/");
}
示例3: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
/**
* Called when the activity is first created. Set the web view layout and
* get the title and file to be displayed.
*
* @param savedInstanceState
* Is used to save the state of the created Activity.
*
* @author Yuriy Stanchev
*
* @email [email protected]
*
* @date 11 Mar 2012
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
Bundle extras = intent.getExtras();
String title = (String) extras.get("title");
String file = (String) extras.get("file");
setContentView(R.layout.about);
setTitle(title);
WebView view = (WebView) findViewById(R.id.web);
view.setFocusable(true);
view.setFocusableInTouchMode(true);
view.requestFocus();
view.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
view.loadUrl(file);
// Initialize the databases for the AIs.
// Intent AIDBInitialization = new Intent(getApplicationContext(),
// AIDBInitialization.class);
// startActivity(AIDBInitialization);
}
示例4: configWebView
import android.webkit.WebView; //导入方法依赖的package包/类
protected void configWebView() {
mWebView = new WebView(getApplicationContext());
mWebViewContainer.addView(mWebView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
WebSettings settings = mWebView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDefaultTextEncodingName("UTF-8");
settings.setSupportZoom(false);
settings.setPluginState(WebSettings.PluginState.ON);
mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
}
示例5: onCreateView
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View mis=inflater.inflate(R.layout.fragment_mis, container, false);
v=(WebView)mis.findViewById(R.id.dd);
v.getSettings().setLoadsImagesAutomatically(true);
v.getSettings().setJavaScriptEnabled(true);
v.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
v.loadUrl("https://172.16.8.45");
return mis;
}
示例6: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
//android.app.ActionBar actionBar = getActionBar();
// actionBar.hide();
setContentView(R.layout.activity_ppt_web_view);
// mVisible = true;
// mControlsView = findViewById(R.id.fullscreen_content_controls);
// mContentView = findViewById(R.id.fullscreen_content);
//
//
// // Set up the user interaction to manually show or hide the system UI.
// mContentView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// toggle();
// }
// });
Intent intent=getIntent();
String url=intent.getStringExtra("modulelink");
url=url.replaceAll(" ","%20");
webView = (WebView)findViewById(R.id.webView2);
webView.getSettings().setJavaScriptEnabled(true);
Uri uri = Uri.parse("https://www.example.com");
// webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src=http%3a%2f%2fvideo.ch9.ms%2fbuild%2f2011%2fslides%2fTOOL-532T_Sutter.pptx");
// webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src=https://www.dropbox.com/s/2scazhwg7o5l2z3/SE1.pptx?dl=1");
// webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src=https://www.dropbox.com/s/n775vtevnwlqzlg/test.pptx?dl=1");
webView.getSettings().setLoadsImagesAutomatically(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
webView.setWebViewClient(new WebViewClient());
webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
// webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src=http%3a%2f%2fvideo.ch9.ms%2fbuild%2f2011%2fslides%2fTOOL-532T_Sutter.pptx");
webView.loadUrl("https://view.officeapps.live.com/op/view.aspx?src="+url);
// Upon interacting with UI controls, delay any scheduled hide()
// operations to prevent the jarring behavior of controls going away
// while interacting with the UI.
// findViewById(R.id.dummy_button).setOnTouchListener(mDelayHideTouchListener);
}
示例7: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_view);
Link=getIntent().getStringExtra("Link");
webView=(WebView)findViewById(R.id.webView);
webView.getSettings().setLoadsImagesAutomatically(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
webView.setWebViewClient(new WebViewClient());
webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webView.loadUrl(Link);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
示例8: initView
import android.webkit.WebView; //导入方法依赖的package包/类
@SuppressLint("NewApi")
private void initView() {
webView = (WebView) findViewById(R.id.webView);
setTitle("关于(V"+getVersionName(this)+")");
settings = webView.getSettings();
settings.setJavaScriptEnabled(true); //如果访问的页面中有Javascript,则WebView必须设置支持Javascript
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setSupportZoom(true); //支持缩放
settings.setBuiltInZoomControls(true); //支持手势缩放
settings.setDisplayZoomControls(false); //是否显示缩放按钮
// >= 19(SDK4.4)启动硬件加速,否则启动软件加速
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
settings.setLoadsImagesAutomatically(true); //支持自动加载图片
} else {
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
settings.setLoadsImagesAutomatically(false);
}
settings.setUseWideViewPort(true); //将图片调整到适合WebView的大小
settings.setLoadWithOverviewMode(true); //自适应屏幕
settings.setDomStorageEnabled(true);
settings.setSaveFormData(true);
settings.setSupportMultipleWindows(true);
settings.setAppCacheEnabled(true);
settings.setCacheMode(WebSettings.LOAD_DEFAULT); //优先使用缓存
webView.setHorizontalScrollbarOverlay(true);
webView.setHorizontalScrollBarEnabled(false);
webView.setOverScrollMode(View.OVER_SCROLL_NEVER); // 取消WebView中滚动或拖动到顶部、底部时的阴影
webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); // 取消滚动条白边效果
webView.requestFocus();
webView.loadUrl("file:///android_asset/about.html");
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
}
示例9: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
/**
* Called when the activity is first created. Creates the splash screen and
* displays it for the defined splash time.
*
* @param savedInstanceState
* is used to save the state of the created Activity.
*
* @author Yuriy Stanchev
*
* @email [email protected]
*
* @date 22 Apr 2012
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/*
* Display the end splash screen inside a webview.
*/
setContentView(R.layout.about);
setTitle("Credits");
WebView view = (WebView) findViewById(R.id.web);
view.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
view.loadUrl("file:///android_asset/credits.html");
/*
* Start the thread for displaying the splash screen.
*/
splashThread = new Thread() {
@Override
public void run() {
try {
synchronized (this) {
/*
* Wait for a moment so the user can see the splash.
*/
wait(splashTime);
interrupt();
}
} catch (InterruptedException e) {
} finally {
finish();
}
}
};
/*
* Start the thread.
*/
splashThread.start();
}
示例10: onCreateView
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_coding, container, false);
TextView title = (TextView)v.findViewById(R.id.codeheading);
title.setText(getArguments().getString("title"));
//Toolbar toolbar = (Toolbar)getActivity().findViewById(R.id.toolbarcoding);
WebView webView = (WebView)v.findViewById(R.id.webview);
//webView.setWebChromeClient(new MyWebViewClient());
//progress.setMax(100);
WebSettings webSettings = webView.getSettings();
webView.setWebViewClient(new WebViewClient());
webSettings.setDefaultFontSize(25);
webView.getSettings().setJavaScriptEnabled(true);
webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webView.getSettings().setBuiltInZoomControls(true);
//webSettings.getSettings().setLoadsImagesAutomatically(true);
if(isNetworkAvailable()) {
Toast.makeText(getActivity(),"Loading Data....",Toast.LENGTH_SHORT).show();
String url = getArguments().getString("url");
//codingFragment.this.progress.setProgress(0);
webView.loadDataWithBaseURL("", url, "text/html", "UTF-8", null);
}
else
{
Toast.makeText(getActivity(),"No Internet. Please Connect to Network...",Toast.LENGTH_SHORT).show();
}
return v;
}