android:imagebutton后台加载时间长 我设计了一个应用程序,它有一个索引页面,链接到多个内容布局,每个布局在屏幕中间都有一个Ipage按钮。ImageButton的代码如下所示: <ImageButton android:id="@+id/image_button" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:background="@drawable/transparent_btn" android:focusable="false" android:gravity="center" android:scaleType="fitCenter" android:src="@drawable/ice_cream400" />
冰淇淋400是一个400*400px的png,大约148KB 问题: 我总是遇到关于图像的问题 根据研究建议,png已经放在android:imagebutton后台加载时间长 我设计了一个应用程序,它有一个索引页面,链接到多个内容布局,每个布局在屏幕中间都有一个Ipage按钮。ImageButton的代码如下所示: <ImageButton android:id="@+id/image_button" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:background="@drawable/transparent_btn" android:focusable="false" android:gravity="center" android:scaleType="fitCenter" android:src="@drawable/ice_cream400" />,android,image,image-processing,imagebutton,Android,Image,Image Processing,Imagebutton,冰淇淋400是一个400*400px的png,大约148KB 问题: 我总是遇到关于图像的问题 根据研究建议,png已经放在可绘制xhdpi文件夹下,因为系统将自动缩小大小 我在real phone设备上运行应用程序,发现有时加载内容布局需要很多时间(大约2秒)。如何提高性能?导入前需要获取屏幕尺寸并缩小比例吗?(imagebutton将占据大约70%的屏幕) 谢谢 你确定是图像造成的问题吗?您是否尝试过使用DDMS对其进行分析以进行验证?对不起…您可以告诉我有关“DDMS”验证的更多信息吗?是
可绘制xhdpi
文件夹下,因为系统将自动缩小大小
我在real phone设备上运行应用程序,发现有时加载内容布局需要很多时间(大约2秒)。如何提高性能?导入前需要获取屏幕尺寸并缩小比例吗?(imagebutton将占据大约70%的屏幕)
谢谢 你确定是图像造成的问题吗?您是否尝试过使用DDMS对其进行分析以进行验证?对不起…您可以告诉我有关“DDMS”验证的更多信息吗?是SDK附带的调试服务。尝试使用方法分析来查看哪些方法占用了太多的时间。谢谢…我已打开DDMS并检查了方法分析…但是那里发生了什么…logcat写入跳过了113帧!应用程序可能在其主线程上做了太多工作。