我已將按鈕添加到我的WebView。但我無法讓它與屏幕底部對齊。我已經給出了下面的代碼。如何將按鈕對齊到屏幕底部
Button button = new Button(context);
button.setText("Button");
LayoutParams params1 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params1.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
button.setLayoutParams(params1);
webView.addView(button);
有誰知道如何做到這一點。
你有沒有嘗試過重力底? – Pull
@Pull我沒有在任何地方找到該選項 – glo
我可以知道你是不是試圖將該按鈕放置在webview下面嗎? y在webview中? – anand