Android的作物背景作物、背景、Android

由网友(往事携冷风)分享简介:我和宽度设置为FILL_PARENT和高度的LinearLayout来WRAP_CONTENT。现在,我想给它一个PNG文件的背景下,但这样做在一个传统的方式导致的LinearLayout,以显示整个的背景,而不是种植的附加部分调整。I have a LinearLayout with width set to fi...

我和宽度设置为FILL_PARENT和高度的LinearLayout来WRAP_CONTENT。现在,我想给它一个PNG文件的背景下,但这样做在一个传统的方式导致的LinearLayout,以显示整个的背景,而不是种植的附加部分调整。

I have a LinearLayout with width set to fill_parent and height to wrap_content. Now I want to give it a background from a png file, but doing it in a traditional way causes the LinearLayout to resize in order to show the whole background instead of cropping the additional part.

如何设置的LinearLayout的背景,所以它不会reisze?

How can I set the background of LinearLayout so it won't reisze?

感谢

推荐答案

看来,这样的事情是可以实现只用的ImageView 并设置 scaleType 参数相应。一个快速的解决方法是使用的FrameLayout ,把的ImageView 根据与透明背景的另一个布局。

It appears that such thing is achievable only using the ImageView and setting the scaleType parameter accordingly. A quick workaround is to use FrameLayout and put the ImageView under another layout with transparent background.

阅读全文

相关推荐

最新文章