无法更改元素在 webview 中的位置

Can't change position of elements in webview

我开发了一个简单的 webview 应用程序,它运行良好。

现在我必须添加一个后退按钮。

我将它添加为 "FrameLayout" 的子项。我可以改变大小,但我不能改变按钮的位置,它只是位于左上角......这似乎是任何元素的情况,我只是用 ImageView 试过,我有同样的问题有了它。

我也尝试使用 "RelativeLayout" 而不是 "FrameLayout" 中建议的 ,但这没有区别

感谢任何帮助。

我推荐使用XML。

将此添加到您的 XML:

<Button
        android:layout_height="wrap_content"
        android:id="@+id/button"
        android:text="Button" 
        android:layout_width="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
    >

或将<RelativeLayout>替换为<android.support.constraint.ConstraintLayout>

阅读 它的工作原理。