如何从安卓网络视图应用程序底部删除白色填充块



我对安卓编码很陌生,我刚刚为我的教会创建了一个网络视图应用程序。apk已成功生成,但我仍然在屏幕底部不断出现这个烦人的空白。

到目前为止,我已经删除了content_main.xml文件中的所有android:p填充引用,但仍然没有成功。

我还在这里搜索,看看是否有其他人有同样的问题,但这些线程只能帮助我摆脱填充代码,而不是底部这个烦人的空白。

如果您需要我发布任何代码,请告诉我。提前感谢!这是我在谈论底部白色块的图片

activity_main.xml------------------

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimaryDark"
        app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />

activity_main.xml------------------

content_main.xml-------------------

<ProgressBar
    android:layout_centerHorizontal="true"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:layout_gravity="center_vertical|center_horizontal"
    android:id="@+id/progressBar1"/>
<TextView
    android:layout_below="@+id/progressBar1"
    android:layout_height="wrap_content"
    android:id="@+id/LoadingText"
    android:layout_width="fill_parent"
    android:text="Loading, Please Wait.."
    android:textSize="20sp"
    android:gravity="center_vertical|center_horizontal">
</TextView>
<WebView
    android:id="@+id/activity_main_webview"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

content_main.xml------------------

主要活动.java------------------包裹组织.communionchapelefca.ccsatx;

    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.graphics.Bitmap;
    import android.os.Bundle;
    import android.view.KeyEvent;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.webkit.WebSettings;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;
    import android.widget.ProgressBar;

公共类 主活动扩展活动 {

private WebView mWebView;
ProgressBar progressBar;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mWebView = (WebView) findViewById(R.id.activity_main_webview);
    progressBar = (ProgressBar) findViewById(R.id.progressBar1);
    WebSettings webSettings = mWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    mWebView.loadUrl("http://communionchapelefca.org/edy-home");
    mWebView.setWebViewClient(new HelloWebViewClient());

}
private class HelloWebViewClient extends WebViewClient{

    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        // TODO Auto-generated method stub
        super.onPageStarted(view, url, favicon);
    }
    @Override
    public boolean shouldOverrideUrlLoading(WebView webView, String url)
    {
        webView.loadUrl(url);
        return true;
    }
    @Override
    public void onPageFinished(WebView view, String url) {
        // TODO Auto-generated method stub
        super.onPageFinished(view, url);
        progressBar.setVisibility(view.GONE);
    }
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{ //if back key is pressed
    if((keyCode == KeyEvent.KEYCODE_BACK)&& mWebView.canGoBack())
    {
        mWebView.goBack();
        return true;
    }
    return super.onKeyDown(keyCode, event);
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}
public void onBackPressed() {
    AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
            MainActivity.this);
    // set title
    alertDialogBuilder.setTitle("Exit");
    // set dialog message
    alertDialogBuilder
            .setMessage("Do you really want to exit?")
            .setCancelable(false)
            .setPositiveButton("Yes",new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog,int id) {
                    // if this button is clicked, close
                    // current activity
                    MainActivity.this.finish();
                }
            })
            .setNegativeButton("No",new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog,int id) {
                    // if this button is clicked, just close
                    // the dialog box and do nothing
                    dialog.cancel();
                }
            });
    // create alert dialog
    AlertDialog alertDialog = alertDialogBuilder.create();
    // show it
    alertDialog.show();
}

}主要活动.java------------------

对于页面的html代码,我们使用Wordpress来托管它。我已经禁用了所有页脚等,因为我认为可能是罪魁祸首。打开页面(www.communionchapelefca.org/edy-home)时,它不会在底部显示白色块。

如果我需要发布任何其他XML或Java文件,请告诉我。感谢您的帮助。

好吧,我所做的修复它只是按回车键大约五次(在文档中的最后一个文本之间添加空格)。然后,我将文本添加到 html 文档的底部,然后将该文本着色为与背景相同的颜色。不是一个漂亮的修复,但它奏效了。

最新更新