问题描述
Dears我想让我的Android应用程序支持多个设备的不同屏幕以及我的平板电脑或智能手机的不同屏幕后旋转
i在所有教程中创建不同大小的图像并放置我的图像在drawable-mdpi,drawable-mdpi,drawable-xhdpi,.....................
我也在我的清单文件中输入这段代码
< supports-screens
android:anyDensity =true
android:largeScreens =true
android:normalScreens =true
android:resizeable =true
android:smallScreens =true
android:xlargeScreens =true/>
和我的活动文件是这样的
<?xml version =1.0 encoding =utf-8?>
< RelativeLayout xmlns:android =http://schemas.android.com/apk/res/android
xmlns:tools =http://schemas.android.com/tools
android:layout_width =match_parent
android:layout_height =match_parent
android:paddingBottom =@ dimen / activity_vertical_margin
android:paddingLeft =@ dimen / activity_horizontal_margin
android:paddingRight =@ dimen / activity_horizontal_margin
android:paddingTop =@ dimen / activity_vertical_margin
tools:context =com.graphicano.peugeot.mycar3>
< ImageView
android:id =@ + id / image
android:layout_width =wrap_content
android:layout_height =wrap_content
android: scaleType =center
android:src =@ drawable / image_10101/>
< / RelativeLayout>
但只显示小尺寸屏幕的图片虽然我运行这个应用程序主要是为平板电脑和三星智能手机..所以在平板电脑我必须显示更大的图像
任何想法请因为我迫切需要它,我不知道如何解决它
我尝试过:
i试图在android studio中制作许多imnages大小并将我的代码放入清单但现在正在工作
急需建议
Dears i want to make my android application support different screens for multiple devices and also different screen afters rotation for my tablet or smart phone
i created as in all tutorials different sizes for images and put my images in drawable-mdpi, drawable-mdpi,drawable-xhdpi,.....................
also i put in my manifest file this code
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
and my activity file is like this one
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.graphicano.peugeot.mycar3"> <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="center" android:src="@drawable/image_10101" /> </RelativeLayout>
but only images for small size of screen is shown while i am running this application mainly for tablets and samsung smart phone.. so in tablet i have to show larger image
any idea please coz i need it urgently and i dont know how to solve it
What I have tried:
i tried in android studio to make many imnages sizes and put my code in manifest but now working at all
need advice urgently
这篇关于Android工作室屏幕bug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!