This is the Android equivalent of this iOS question.
Trying to create a view that contains a MapView at about 20% of the screen (under an ActionBar...) and the rest of the screen is a ScrollView that when scrolling down, overlaps on top of the MapView and hides it. In short like FourSquare's Android app. Any ideas?
The android ScrollView can hold only one direct child. In case, if we want to add multiple views within the scroll view, then we need to include them in another standard layout like linearlayout , relativelayout , framelayout, etc.
Now open activity_main.xml file in your android application and write the code like as shown below. If you observe above code, we used a HorizontalScrollView to enable horizontal scrolling for linearlayout whenever the content exceeds layout screen. When we run the above example in the android emulator we will get a result like as shown below.
This example demonstrates the steps involved to create a ScrollView in Android using Kotlin. Click on File, then New => New Project. Choose “Empty Activity” for the project template. Select language as Kotlin. Select the minimum SDK as per your need. Add some strings inside the strings.xml file to display those strings in the app.
I've made an implementation based on AndroidSlidingUpPanel (many thanks to this project).
Details http://android.amberfog.com/?p=915 Source code with example: https://github.com/dlukashev/AndroidSlidingUpPanel-foursquare-map-demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With