开发者

Problem following the Android TabLayout tutorial

开发者 https://www.devze.com 2023-02-14 15:42 出处:网络
Working through the Android TabLayout tutorial I ran into a problem. I think the tutorial is incomplete.

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

精彩评论

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