我正在尝试在片段中调用库但不知道如何在片段中设置它我已经在主要活动中完成了但是在我的片段中设置 setContentView 编译依赖项时出现错误
compile 'com.github.medyo:android-about-page:1.0.2'
我的片段内容视图
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_navigation, container, false);
Element versionElement = new Element();
versionElement.setTitle("Version 6.2");
Element adsElement = new Element();
adsElement.setTitle("Advertise with us");
View aboutPage = new AboutPage(getActivity())
.isRTL(false)
.addItem(versionElement)
.addItem(adsElement)
.addGroup("Connect with us")
.addEmail("elmehdi.sakout@gmail.com")
.addFacebook("the.medy")
.addTwitter("medyo80")
.addYoutube("UCdPQtdWIsg7_pi4mrRu46vA")
.addPlayStore("com.ideashower.readitlater.pro")
.addInstagram("medyo80")
.addGitHub("medyo")
.create();
setContentView(aboutPage);
return rootView;
}
我在倒数第二行遇到错误,如何解决这个问题。以下库将在 api 20+ 库中工作https://github.com/medyo/android-about-page