using theme or ImageView ?
相关问题
- Views base64 encoded blob in HTML with PHP
- How can I create this custom Bottom Navigation on
- How to get the background from multiple images by
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
相关文章
- 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
We can easily place the background image in PercentFrameLayout using the ImageView. We have to set the scaleType attribute value="fitXY" and in the foreground we can also display other view's like textview or button.
use the
android:background
attribute in your xml. Easiest way if you want to apply it to a whole activity is to put it in the root of your layout. So if you have a RelativeLayout as the start of your xml, put it in here:You can set the "background image" to an activity by setting
android:background
xml attributes as followings:(Here, for example, Take a LinearLayout for an activity and setting a background image for the layout(i.e. indirectly to an activity))
Nowadays we have to use
match_parent
:Place the Image in the folder drawable. drawable folder is in res. drawable have 5 variants drawable-hdpi drawable-ldpi drawable-mdpi drawable-xhdpi drawable-xxhdpi
and dont forget to clean your project after writing these lines you`ll a get an error in your xml file until you´ve cleaned your project in eclipse: Project->Clean...