2016-05-26 34 views
0

我必須在我的活動上實現一個Showcase View序列(重要!),並且此Showcase View序列必須在Activity的對象(如EditText,TextView,Button等)之間移動。 我沒有找到很多文檔,並且文檔不能滿足我的需要,所以我會問在這裏是否有人知道如何做到這一點。ShowCase查看序列

謝謝大家!

+1

試試這個:https://github.com/deano2390/MaterialShowcaseView有一個例子。 – ThinkingMonkey

+0

是的,我試過了,但Android Studio無法解決依賴(我的意思是編譯:「blabla」); –

回答

4

感謝@ThinkingMonkey該鏈接。這個對我有用! 有點晚了,但我希望這可以幫助某人一段時間。

Material Showcase View文件:

添加maven { url "https://jitpack.io" }項目的下build.gradle allproject的倉庫。

allprojects { 
    repositories { 
     jcenter() 
     maven { url "https://jitpack.io" } 
    } 
} 

2.添加compile 'com.github.deano2390:MaterialShowcaseView:[email protected]'內部模塊的build.gradle的dependencies {...}

3.申報目標:如果單次使用

 ToggleButton target1 = (ToggleButton) findViewById(R.id.togglebutton); 
     TextView target2 = (TextView) findViewById(R.id.text); 
     Button target3 = (Button) findViewById(R.id.button); 

4.提供ID。

private static final String SHOWCASE_ID = "1"; 

5.這裏是材料陳列室視圖序列的代碼示例。

ShowcaseConfig config = new ShowcaseConfig(); 
config.setDelay(500); // half second between each showcase view 

MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this, SHOWCASE_ID); 

sequence.setConfig(config); 

sequence.addSequenceItem(target1, 
        "This is button one", "GOT IT"); 

sequence.addSequenceItem(target2, 
        "This is button two", "GOT IT"); 

sequence.addSequenceItem(target3, 
        "This is button three", "GOT IT"); 

sequence.start(); 

這一切都取決於你,如果你想要把它放在onclickmenu optionsoncreate