在Android布局中防止拉伸背景图像

时间:2017-02-10 10:35:42

标签: android android-layout responsive-design

我有一个图像,我想在布局中用作背景,然后我想在这个背景上添加另一个像textview的视图。现在问题是我不希望这种背景在不同的设备或屏幕尺寸中伸展。我希望它保持相同的大小,然后将我的其他视图包装在此背景图像中。

this is the image with Relative layout and imageview as a background

我试图实现的目标:

  1. 我在StackOverflow上搜索但我没有找到解决问题的相关解决方案。

  2. 我尝试在Linear,Relative和Framelayout中使用此背景图像,但随后它就像这样对图像进行拉伸:

  3. framelayout streches the background image same goes for linear and relative layout

    只有ImageView才能阻止它进行拉伸,但正如您所知,我们无法将Imageview用作容器。

0 个答案:

没有答案