0

我在使用设计师提供的资产来实现带有右侧 ImageButton 的 SearchBox 时遇到问题。我不确定问题是因为资产还是我的实施。

它应该看起来像这样,并且在 hdpi 手机中也是如此。

但是看看它在 xhdpi 模拟手机中的样子

它也在真实设备上进行了测试。每个没有 hdpi 的设备看起来都像第二个例子。这是我的实现:

<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="10dp"
android:paddingRight="10dp"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:background="#e9e9e9" >

<ImageButton 
    android:background="@drawable/home_btn_ubicacion"
    android:src="@drawable/home_icono_ubicacion"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:id="@+id/button"/>
<AutoCompleteTextView 
    android:layout_toLeftOf="@id/button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/home_input_buscar"
    android:hint="Ciudad o Barrio"
    android:layout_alignParentLeft="true"
    />

由于我的声誉,我不允许发布图像,所以我在 github 上共享整个测试项目:github.com/ejmedina/SearchBoxTestProject

同样,由于代表低,它看起来不像链接。一如既往地提前感谢大家。

4

1 回答 1

0

设计师发送了解决问题的新资产。

似乎他用 Photoshop 制作了第一个补丁,但补丁没有按预期工作。

我已将新资产推送到我的 github 存储库,它们将保留在那里以用于教育目的。

于 2013-05-07T13:50:33.710 回答