开发者

Clicking on the entire row of Android ListView

开发者 https://www.devze.com 2023-02-16 12:06 出处:网络
I have Created a ListView and set a background image.Everything goes fine except I am unable to click on the right side of the row of ListView.Can anybody help me this.

I have Created a ListView and set a background image.Everything goes fine except I am unable to click on the right side of the row of ListView.Can anybody help me this. Below is the xml file...

    <ListView 
       android:layout_width="wrap_cont开发者_如何学JAVAent" 
       android:id="@+id/JSONListView"
       android:layout_height="wrap_content" 
       android:background="@drawable/listbg"
       android:focusable="false" 
       android:cacheColorHint="#00000000"
       android:visibility="visible" >
    </ListView>

And I am not using any View.


Use the attribute

  android:layout_width="match_parent" 

and set click listener for items.


I guess you have created your custom adapter. If so, just go to the getView() method of that custom adapter and on the holder instance of that portion of listitem add a onCLickListener.


Provide more info. XML layout, etc.

Im guessing there is a view there or it is not filling the entire width but difficult to say.

Android ListView Activity

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号