支持多种屏幕大小的Android Studio默认为最小图像
我试图支持所有屏幕大小。我已经学习了很多教程,这就是我所拥有的支持多种屏幕大小的Android Studio默认为最小图像,android,dpi,Android,Dpi,我试图支持所有屏幕大小。我已经学习了很多教程,这就是我所拥有的 <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens= "true" android:anyDensity="true" /> 已添加到android清单中 我已经导入了使用Android在线工具创建
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens= "true"
android:anyDensity="true"
/>
已添加到android清单中
我已经导入了使用Android在线工具创建的9个补丁文件
但在所有设备上,它似乎仍然默认为最小的图片。以下是HTC One Maxx(5.9英寸屏幕)的屏幕截图
按钮的Android布局:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/account_button_pressed"></item>
<item android:state_focused="true" android:drawable="@drawable/account_button_focused"></item>
<item android:drawable="@drawable/account_button_normal"></item>
</selector>
Android屏幕布局:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center">
<!-- TODO: Update blank fragment layout -->
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/directmessage_button"
android:id="@+id/btn_DirectMessages"
android:background="#0000"
android:padding="20px"
android:focusableInTouchMode="false" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/instantmessage_button"
android:id="@+id/btn_InstantMessage"
android:layout_toRightOf="@+id/btn_DirectMessages"
android:background="#0000"
android:padding="20px"
android:focusableInTouchMode="false"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/reports_button"
android:id="@+id/btn_Reports"
android:layout_below="@+id/btn_DirectMessages"
android:background="#0000"
android:padding="20px"
android:focusableInTouchMode="false"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/conference_button"
android:id="@+id/btn_Conference"
android:layout_toRightOf="@+id/btn_Reports"
android:layout_below="@+id/btn_DirectMessages"
android:background="#0000"
android:padding="20px"
android:focusableInTouchMode="false"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/account_button"
android:id="@+id/btn_Account"
android:layout_below="@+id/btn_Reports"
android:background="#0000"
android:padding="20px"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/filetransfer_button"
android:id="@+id/btn_FileTransfer"
android:layout_below="@id/btn_Conference"
android:layout_toRightOf="@+id/btn_Account"
android:background="#0000"
android:padding="20px"/>
</RelativeLayout>
</ScrollView>