我很好奇如何在我的應用程序中添加一種類似於附加圖像的教程功能,其中應用程序頂層(本例中爲主屏幕)上有一層。 如何將教程功能添加到應用程序?
-1
A
回答
0
使用https://github.com/Espiandev/ShowcaseView它正是你在屏幕截圖上顯示的。
0
要在視圖的頂部創建一個圖層,您可以在RelativeLayout或FrameLayout中創建主視圖,並將新視圖添加到主視圖的RelativeLayout或LinearLayout中,並將新視圖的背景設置爲Alpha黑色(<color name="alphablack">#80000000</color>
),這是一個代碼示例:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlContainerMain"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:text="HELLO WORLD!"/>
<RelativeLayout
android:id="@+id/rlLayer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/alphablack"
android:visibility="gone">
</RelativeLayout>
</RelativeLayout>
在第一設置的層的可見性,以消失,如果要被示出的層可以設置與view.setVisibility可視性(View.VISIBLE)並且在教程完成後,您可以使用view.setVisibility(View.GONE)將其解除。我希望我的回答可以幫助你,但如果你對我的回答有其他問題,請隨時在評論中提問:)
相關問題
- 1. 如何將暫停/恢復功能添加到應用程序?
- 2. 如何將功能添加到iPhone應用程序?
- 3. 如何將iOS「Open In ...」功能添加到應用程序
- 4. 如何將Windows 7功能區添加到WTL應用程序
- 5. 將集羣功能添加到C++ 11線程應用程序
- 6. 如何獲取IzPack將程序添加到程序和功能
- 7. 如何添加smtp發送功能到我的應用程序
- 8. 如何添加作物功能到OCR應用程序?
- 9. 將搜索功能添加到我的應用程序Android
- 10. 將推送通知功能添加到現有應用程序
- 11. 將備份功能添加到iPhone應用程序?
- 12. 將iPhone功能添加到iPad應用程序
- 13. 將刪除功能添加到CGContext應用程序
- 14. 將功能測試添加到Backbone.js應用程序
- 15. 將博客功能添加到現有的Rails應用程序
- 16. 將語音添加到iOS應用程序的文本功能
- 17. 將聊天功能添加到基本的rails應用程序
- 18. 將privateNetworkClientServer功能添加到Windows 8 Cordova應用程序
- 19. 將IVR和PBX功能添加到Web應用程序
- 20. 將反饋功能添加到應用程序
- 21. 在Hartl教程後向Rails應用程序添加密碼重置功能
- 22. 如何使用Corona SDK將Share功能添加到Android應用程序?
- 23. 如何將視頻聊天功能添加到我的導軌應用程序?
- 24. 如何將縮放功能添加到我現有的Flash應用程序中?
- 25. 如何將功能區菜單添加到現有的MFC應用程序中?
- 26. 如何將一個功能區添加到窗體應用程序
- 27. 如何將stciky筆記功能添加到我的android應用程序中?
- 28. 如何將鑰匙串共享功能添加到我的應用程序ID?
- 29. 如何將簡單的CMS功能添加到現有的Symfony應用程序
- 30. 如何將功能添加到C#中的Winforms程序?