【发布时间】:2013-07-15 08:46:29
【问题描述】:
我目前有一个正在运行的 android 应用程序,我正在 ecrise 中编程,但我想更改 UI 并添加我自己的感觉,但是当我重新缩放页面上的按钮时,按钮的轮廓变得非常模糊,我该怎么做才能解决这个问题?
目前我正在将按钮的背景设置为一个名为 background.xml 的 xml 文件
<?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/button_pressed" /> <!-- pressed -->
<item android:state_enabled="false"
android:drawable="@drawable/button_disabled"/> <!-- disabled -->
<item android:state_focused="true"
android:drawable="@drawable/button_focused" /> <!-- focused -->
<item android:drawable="@drawable/button_normal" /> <!-- default -->
</selector>
我们将不胜感激任何解决问题的想法。
这是模糊按钮的照片
好的,我已经完成了 9patch,但现在图像内部有一条黑线,有什么想法吗?
【问题讨论】:
-
是否已预设可绘制对象 - 9 个补丁?
-
不,我只是用 gimp 做了一个盒子
-
如果resources里的图片比实际显示的小,显示的时候会模糊
-
我应该在 9patch 图像中使用什么尺寸的图像(尺寸)以获得最佳效果?我应该为 9 个补丁图像使用什么尺寸,因为我的图像不再显示,我也可以将 xml 从“@drawable/button_normal”更改为“@drawable/button_normal.9”
-
好的,谢谢大家,9patch 运行良好,我不需要使用图像按钮,按钮在设备上的应用程序中显示效果很好,谢谢
标签: android eclipse image button blurry