A small tip to explore how to call a method of a control
生活随笔
收集整理的這篇文章主要介紹了
A small tip to explore how to call a method of a control
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Created by Jerry Wang, last modified on Mar 20, 2015
一個很小的tip:比如我想把一個table里的每個column 設置成寬度自適應的,需要知道應該call哪個方法來實現。
[外鏈圖片轉存失敗(img-zsZYaNSR-1568514504160)(https://user-images.githubusercontent.com/5669954/27319091-09e05484-5590-11e7-9566-d5418a44d2b9.png)]
一種辦法是查help 文檔,另一種辦法是在debugger里研究:
根據經驗這種API一般naming convention都是set:
根據經驗定位到應該call setAutoResizable這個方法。下一個問題就是這個方法到底應該傳什么參數進去。
直接在debugger里執行方法getMetadata, 展開返回的結果:
這里說明這個set方法應該傳一個boolean進去:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的A small tip to explore how to call a method of a control的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 莱昂纳多・迪卡普里奥主演,《花月杀手》电
- 下一篇: A good debug paramet