WebViewの上にボタンを配置したいのです。
現状は下記のURLのような状態で画面いっぱいにWebViewを配置しています。
https://gyazo.com/1531292b8f762f0fdc68b30b76c1e23f
このWebViewの上にButtonを配置したいと考えているのですが、デザイン上でそのままButtonをドラックアンドドロップすると、ButtonがWebViewの裏に隠れてしまいます。
lang
1<?xml version="1.0" encoding="utf-8"?> 2<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:app="http://schemas.android.com/apk/res-auto" 4 xmlns:tools="http://schemas.android.com/tools" 5 android:layout_width="match_parent" 6 android:layout_height="match_parent" 7 tools:context=".MainActivity" 8 android:background="#FFFF00"> 9 10<LinearLayout 11 android:layout_width="match_parent" 12 android:layout_height="match_parent"> 13 14 <WebView 15 android:id="@+id/myWebView" 16 android:layout_width="match_parent" 17 android:layout_height="match_parent" 18 android:layout_alignParentLeft="true"> 19 20 <Button 21 android:id="@+id/button3" 22 android:layout_width="match_parent" 23 android:layout_height="wrap_content" 24 android:text="Button" 25 tools:layout_editor_absoluteX="148dp" 26 tools:layout_editor_absoluteY="172dp" /> 27 </WebView> 28</LinearLayout> 29</android.support.constraint.ConstraintLayout>
コードはこんな感じです。実行するとボタンは表示されているのですが、デザインでレイアウトを設定したいので見えていないとボタンの位置をコードでしか変えることができないと思うので、難しいです。
ボタンを最前面に表示してレイアウトを作ることはできないのでしょうか?
回答1件
あなたの回答
tips
プレビュー