我有一個包含一個TextView一個ListView,我需要放大按鈕點擊這個TextView的,但我不能這樣做,我什麼都試過重寫simplecursor適配器和覆蓋getview()方法,但couldn」牛逼放大按鈕點擊TextView的,按鈕列表視圖外,我的代碼是:放大列表視圖
這是ListView的佈局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/bt_rating"
android:focusable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:button="@android:drawable/btn_star"
android:onClick="onclick"/>
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/FontSizeInListView"
android:gravity="right"
/>
</LinearLayout>
編輯
adapter.setViewBinder(new SimpleCursorAdapter.ViewBinder(){
Binds the Cursor column defined by the specified index to the specified view
public boolean setViewValue(View view, Cursor cursor, int columnIndex){
if(view.getId() == R.id.text1){
tv=(TextView)view;
}}**
所以這種方式,我得到的TextView,但肯定只有最後創建的一個將被渲染和縮放我做tv.settextsize(..)
但只有頁面上創建了最後的TextView將改變,因爲我只有一個的ID,這樣我怎麼能獲取所有文字瀏覽,而不僅僅是最後一個創建的?
您將需要一個自定義列表適配器。如果你已經使用了,你可以發佈你的getView方法嗎? – Tenfour04
是的,我發佈了它。 –