I am trying to create a Map App that allows you to switch between map and satellite view using two buttons. However, when I add the two buttons the map is being shrunk down to not take up the full screen of the device.
How can I make it so that the map takes up the entire screen, and then the buttons are below that screen when you scroll down? Here is the code for the layout file:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:layout_height="wrap_content"
android:layout_width="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
map:uiZoomControls="true"
tools:context=".MapsActivity" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Map View"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Satellite View"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
hello try FrameLayout instead of LinearLayout