java – Android展示查看如何使用?
作者:互联网
很好的展示视图
我用这个:
https://github.com/amlcurran/ShowcaseView
导入文件后,它会出错.这是我的错误和improted .jar文件
错误说
在java中
R cannot be resolved to a variable
很有型
error: Error retrieving parent for item: No resource found that matches the given name ‘Theme.Sherlock.Light’.
再次,风格
error: Error: No resource found that matches the given name: attr ‘android:fontFamily’.
还有任何教程在我的项目中使用Showcase视图.我找不到,我从github项目中没有理解.不清楚.
解决方法:
这个库对所有人都很棒.这个怎么运作??我想突出显示工具栏选项.现在只需添加库并编写这样的代码.
您可以使用此代码使用多个showCaseView
1在我们的Gradle.build中添加库
implementation ‘com.github.mreram:ShowCaseView:1.0.5’
简单地使用传递标题,描述文本,视图或视图ID和类型调用此方法
ShowIntro("SetTheme", "Select Theme and Apply on your video", R.id.button_tool_theme, 1);
方法像这样创建
private void ShowIntro(String title, String text, int viewId, final int type) {
new GuideView.Builder(this)
.setTitle(title)
.setContentText(text)
.setTargetView((LinearLayout)findViewById(viewId))
.setContentTextSize(12)//optional
.setTitleTextSize(14)//optional
.setDismissType(GuideView.DismissType.targetView) //optional - default dismissible by TargetView
.setGuideListener(new GuideView.GuideListener() {
@Override
public void onDismiss(View view) {
if (type == 1) {
ShowIntro("Editor", "Edit any photo from selected photos than Apply on your video", R.id.button_tool_editor, 6);
} else if (type == 6) {
ShowIntro("Duration", "Set duration between photos", R.id.button_tool_duration, 2);
} else if (type == 2) {
ShowIntro("Filter", "Add filter to video ", R.id.button_tool_effect, 4);
} else if (type == 4) {
ShowIntro("Add Song", "Add your selected song on your video ", R.id.button_tool_music, 3);
} else if (type == 3) {
ShowIntro("Overlay", "Add your selected overlay effect on your video ", R.id.button_tool_overlay, 5);
} else if (type == 5) {
SharePrefUtils.putBoolean("showcase", false);
}
}
})
.build()
.show();
}
标签:import-libraries,android,java,github,showcaseview 来源: https://codeday.me/bug/20190927/1823433.html