开发者

Problem following the Android TabLayout tutorial

Working through the Android TabLayout tutorial I ran into a problem.

I think the tutorial is incomplete.

When I add

spec = tabHost.newTabSpec("artists").setIndicator("Artists",
 开发者_JAVA技巧                         res.getDrawable(R.drawable.ic_tab_artists)) 

in the onCreate method, I get

c_tab_artists cannot be resolved or is not a field.

I've created the corresponding XML file in the drawable directory but the problem persists.

Does anyone know the reason for this error?


ic_tab_artists is the icon you're supposed to copy to the drawable directory. In the tutorial, see step 3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜