我在main.xml中间设置
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
>
其中background是一张png格式的图片,但是显示却是白色,后来我又找了几张图,同样大小,同样格式,有的能显示,有的却是只显示白色。。求解。这是为什么?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
>
其中background是一张png格式的图片,但是显示却是白色,后来我又找了几张图,同样大小,同样格式,有的能显示,有的却是只显示白色。。求解。这是为什么?
解决方案 »
- 如何让程序的界面不翻转
- 两台手机通过socket相连,一直处于阻塞状态,为何?
- 有点小急!!!如何将android通过吸墨API访问书籍
- 策划一句话就做死人啊。特来求助搜索框怎么去掉搜索按钮?
- 解析XML出错了
- Spinner的onItemClickListener 无法运行?
- intent传递list:PackageInfo.activities,PackageInfo.services,PackageInfo.permissions
- Phonegap这种用html5做移动开发的有前景么?
- 很急!求大神,帮个小忙,我已经把图片保存路径放入数据库,想在listView上显示,求帮下忙,或者,给个下载源码的地址!
- android(6.0)如何在service中启动系统弹框
- 入门问题,如何为Hello World APP添加第二个窗体?
- android 如何在view里关闭activity
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background3"
>
<com.lb.dragtest.MyViewPager
android:id="@+id/viewpager"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center"
/> <RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:id="@+id/viewGroup"
android:gravity="center_horizontal"
android:layout_marginBottom="120dp"
>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
>
<Button
android:id="@+id/packets"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:onClick="shoppingcart"
android:background="@drawable/shopping_cart_normal"
/>
</RelativeLayout>
</RelativeLayout>
这个没有默认背景。那个并不是设置不了背景,而是,有的图片能,有的图片不能,而且这些图片是同样分辨率,同样格式。
不能的都是以纯白色为背景表现出来的。不明白为什么。难道Android的背景设置的图片还需要别的什么条件的?