I want to make custom Info window for google map I can make it but I am not able to make triangle bellow layout. I can add image there but layout have shadow on outer line. Anyone suggest me what to do. how to make portion inside red area. as you can see outer layout have shadow.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You can use the Material Component Library to create custom shapes.
The library provides the
TriangleEdgeTreatment
which creates a triangle treatment of the given size, which faces inward or outward relative to the shape.You can use something like:
Also for edge treatments the parent view must disable clipping of children by setting
android:clipChildren="false"
in xml.clipToPadding
may also need to befalse
if there is any padding on the parent that could intersect the shadow.You can create this custom shape using
<layer-list>
. Below is a working example. Putcustom_triangular_shape.xml
into yourres/drawable
folder.custom_triangular_shape.xml
USE:
OUTPUT:
Hope this will help~
Try this:
For triangle :
For rectangle:
Use both xml in the Layout :
You can make use of layer-list. Create a triangular shape at the bottom, then create a rectangular shape as next layer and give bottom margin that matches your triangle's height.
here is a sample to make triangle shape. https://stackoverflow.com/a/18421795/1987045
Using PopUpWindow you can achieve your goal. Here is a good link to start with.
You can use a 9patch as background for your custom layout.