如何伸展单个图像作为Android的布局的背景吗? [英] How to stretch a single image as background in android layout?

查看:183
本文介绍了如何伸展单个图像作为Android的布局的背景吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

主屏幕这包含只搜索我想要的backgorund形象是我的标志。

Homescreen this contains only search and i want the backgorund image to be my logo.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/image"
tools:context=".MainActivity" >

<EditText
    android:id="@+id/editText1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="text"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_marginBottom="178dp"
    android:layout_marginLeft="40dp"
    android:ems="10" />

<SearchView
    android:id="@+id/searchView1"
    android:layout_width="300dp"
    android:layout_height="wrap_content"
    android:layout_alignTop="@+id/editText1" >

</SearchView>

我需要的全尺寸图像显示该code显示我的标志的无数份的瓷砖格式。

I need the full size image to be displayed this code displays numerous copies of my logo in a tile format.

推荐答案

您应该删除此;

安卓背景=@绘制/图像

android:background="@drawable/image"

和在RelativeLayout的添加此;

and add this in RelativeLayout;

<ImageView
    android:layout_width="wrap_parent"
    android:layout_height="wrap_parent"
    android:layout_centerInParent="true"
    android:src="@drawable/image" />

这篇关于如何伸展单个图像作为Android的布局的背景吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆