0
我有这样的代码选择更改图像的大小:安卓:在ListView项目
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Button Focused-->
<item android:state_focused="true"
android:state_pressed="false"
android:drawable="@drawable/gradient_background"
/>
<!-- Button Focused Pressed-->
<item android:state_focused="true"
android:state_pressed="true"
android:drawable="@drawable/gradient_background"
/>
<!-- Button Pressed-->
<item android:state_focused="false"
android:state_pressed="true"
android:drawable="@android:drawable/ic_search_category_default"
/>
<!-- Button Default Image-->
<item android:drawable="@drawable/gradient_background"/>
</selector>
而且在使用这个选择的活动,我有这样的:
<ListView
android:id="@+id/contactsView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/searchButton"
android:divider="@color/DarkGoldenrod"
android:dividerHeight="0.1dp"
android:listSelector="@drawable/list_selector"
android:drawSelectorOnTop="true" />
现在,这是一个什么样的ListView项看,当你点击并按住像一个例子...
我的问题是:无论如何,我可以让这张照片更小并将其对齐到右侧?
谢谢。
@ some-web感谢您指导我的相关部分,我是一名初学者的android程序员,这真的帮了我很多。 – Ogen
在启动时遇到同样的问题,只需浏览vogella和adnroid开发者一方(通过谷歌),并继续阅读,你会越来越好! –