I'm new to programming. I was using Graphical Layout then when I was reading xml file, I saw FrameLayout. Then I searched, but I couldn't find something useful. What is FrameLayout and what does it do?
相关问题
- 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
FrameLayout
is designed to block out an area on the screen to display a single item. Generally,FrameLayout
should be used to hold a single child view, because it can be difficult to organize child views in a way that’s scalable to different screen sizes without the children overlapping each other. You can, however, add multiple children to aFrameLayout
and control their position within theFrameLayout
by assigning gravity to each child, using theandroid:layout_gravity
attribute.Child views are drawn in a stack, with the most recently added child on top.
The source are here - https://medium.com/@anamikatripathi1601/android-beginners-views-layouts-657a5bbeebe2
Another popular approach of using
FrameLayout
it isFragment
containerBasically it puts one view on top of another for example :
Inflating text on Image
Are you sure that you googled it?
You can consider the word
frame
as regular photo frame. What you do with that frame? you can place photos in that frame by one top to another. Same as inFrameLayout
we can place views ( Any layout, or widget like button, text, image so on) top of other as @ojonugwa shows you the textview top of the Image.You use a FrameLayout to stack child views on top of each other, with the most recent child on top of the stack. In the example below, the TextView is the most recent, so it is automatically placed on top of the ImageView.
For example:
Output: