![](/img/trans.png)
[英]Android - PNG image has alpha channel, but when in imageview white background is shown. How can I fix?
[英]how I can fix android background image
你好 我有android應用,但無法在側面簡單修復圖像。
活動風格
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main" tools:context=".MainActivity"
android:focusableInTouchMode="false"
android:background="@drawable/background">
<com.facebook.login.widget.LoginButton
android:id="@+id/login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="96dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
style="@style/FacebookLoginButton"/>
</RelativeLayout>
請幫助,我該如何解決
要在android上支持多種屏幕分辨率,您應該在可繪制文件夾中添加特定分辨率的背景圖像。
您可以遵循這些圖像尺寸
xxxhdpi:1280x1920像素
xxhdpi:960x1600 px
xhdpi:640x960 px
hdpi:480x800像素
分辨率:320x480像素
ldpi:240x320像素
針對您的情況,針對您的自定義平板電腦:如果您創建尺寸為2560x1600的圖片並將其放置在可繪制的文件夾中,則它將完全適合您的平板電腦屏幕
這是在同一http://developer.android.com/guide/practices/screens_support.html上獲取更多信息的鏈接
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.