亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

android - 重寫onTouch方法,如何通過判斷自定義view的某個屬性值來返回不同的返回值
天蓬老師
天蓬老師 2017-04-17 17:38:41
0
5
570

第一個參數(shù)傳的是自定義view,我想實現(xiàn)通過判斷自定義view里的一個布爾類型的屬性來給onTouch方法不同的返回值??墒羌t框那里要怎么寫?我試圖用instanceof來判斷v是否為自定義view的實例??墒且恢狈祷豧alse。

天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進(jìn)步~~

reply all(5)
小葫蘆

(CustomView)How about force-forwarding the view?

巴扎黑

Suggestion: You print the view ID and see if it is the same as the view ID when you created the popupwindows; it feels like this view does not represent the view you clicked.

PHPzhong

You can use debug to check the type of View. If you want to set the onTouch event of popupWindow, why not write it directly in the popupWindow class. In this case, you can directly set the view for a desired view. Implemented onTouch

迷茫

Set a tag for the custom View and judge it through getTag

PHPzhong

If instanceof does not hold, it may not be an event received by the custom view. You can analyze it from this aspect. If so, type conversion after instanceof is no problem and can be handled like this

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template