0

当我在 Web 界面中选择 EditText 时,出现软键盘但太大。这使我不会丢失 EditText。我该如何解决这个问题?

4

1 回答 1

0

//请尝试使用下面的代码。

框架布局 mFrame;

 @Override

public void onCreate(Bundle savedInstanceState) 

{

super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);

mFrame = new FrameLayout(getContext());
    mFrame.setPadding(PADDING, PADDING, PADDING, PADDING);
    setContentView(mFrame);
    mFrame.setVisibility(View.INVISIBLE);

    mContent = new FrameLayout(getContext());
    mContent.setPadding(PADDING, PADDING, PADDING, PADDING);
    mFrame.addView(mContent);

    PaintDrawable background = new PaintDrawable(Color.BLACK);
    background.setAlpha(BORDER_ALPHA);
    background.setCornerRadius(BORDER_RADIUS);
    mContent.setBackgroundDrawable(background);

    setUpWebView();

}

私人无效 setUpWebView() {

    LayoutInflater inflater = this.getLayoutInflater();

    mWebView = (WebView)inflater.inflate(R.layout.twitter_layout, null);

    mWebView.getSettings().setJavaScriptEnabled(true);

    mWebView.getSettings().setSaveFormData(false);

    mWebView.getSettings().setSavePassword(false);

    mWebView.setWebViewClient(new TwitterWebViewClient());

    mWebView.loadUrl(mUrl);

    mContent.addView(mWebView);
}
于 2013-07-12T06:32:05.183 回答