歡迎和大家交流技術相關問題:
郵箱: jiangxinnju@163.com
博客園地址: http://www.cnblogs.com/jiangxinnju
GitHub地址: https://github.com/jiangxincode
知乎地址: https://www.zhihu.com/people/jiangxinnju
以Windows 10 + Android Studio 3.0.1為例
默認情況下,在Android Studio中將鼠標移動到函數位置處無法顯示懸浮提示,需要進行如下設置:
File -> Settings -> Editor -> General
選中Show quick documentation on mouse move
點擊OK
但是此時如果將鼠標移動到函數位置處,會顯示"fetching documentation",如果你網絡比較好的話,等一會后會顯示文檔,但是如果網絡不好的話則永遠不會顯示。這是因為Android Studio發現你沒有在本地下載對應的文檔,所以去google官網進行下載,速度比較慢。將文檔下載到本地的方式是:
Toos -> Android -> SDK Manager
選擇SDK Tools
頁簽,勾選Documentation for Android SDK
點擊OK,下載完成后重啟Android Studio應該很快看到懸浮文檔提示了。
但是如果還不行的話,可能原因是對應的Android Studio版本優先從網絡獲取文檔,即使你在本地下載了文檔也不行,此時需要參考下面的地址,將默認讀取方法進行修改:https://stackoverflow.com/questions/23378610/android-studio-quick-documentation-always-fetching-documentation