{"action":"opened","issue":{"url":"https://api.github.com/repos/hackware1993/MagicIndicator/issues/20","repository_url":"https://api.github.com/repos/hackware1993/MagicIndicator","labels_url":"https://api.github.com/repos/hackware1993/MagicIndicator/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/hackware1993/MagicIndicator/issues/20/comments","events_url":"https://api.github.com/repos/hackware1993/MagicIndicator/issues/20/events","html_url":"https://github.com/hackware1993/MagicIndicator/issues/20","id":190473666,"number":20,"title":"titie中文时，文字没有居中","user":{"login":"chenwulue","id":7657440,"avatar_url":"https://avatars.githubusercontent.com/u/7657440?v=3","gravatar_id":"","url":"https://api.github.com/users/chenwulue","html_url":"https://github.com/chenwulue","followers_url":"https://api.github.com/users/chenwulue/followers","following_url":"https://api.github.com/users/chenwulue/following{/other_user}","gists_url":"https://api.github.com/users/chenwulue/gists{/gist_id}","starred_url":"https://api.github.com/users/chenwulue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenwulue/subscriptions","organizations_url":"https://api.github.com/users/chenwulue/orgs","repos_url":"https://api.github.com/users/chenwulue/repos","events_url":"https://api.github.com/users/chenwulue/events{/privacy}","received_events_url":"https://api.github.com/users/chenwulue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-19T03:30:22Z","updated_at":"2016-11-19T03:30:22Z","closed_at":null,"body":"使用以下这种样式（TAB WITH BADGE VIEW页面的第三个）\r\n`MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator3);\r\n//        magicIndicator.setBackgroundResource(R.drawable.round_indicator_bg);\r\n        CommonNavigator commonNavigator = new CommonNavigator(this);\r\n        commonNavigator.setAdapter(new CommonNavigatorAdapter() {\r\n            @Override\r\n            public int getCount() {\r\n                return mDataList == null ? 0 : mDataList.size();\r\n            }\r\n\r\n            @Override\r\n            public IPagerTitleView getTitleView(Context context, final int index) {\r\n                BadgePagerTitleView badgePagerTitleView = new BadgePagerTitleView(context);\r\n\r\n                ClipPagerTitleView clipPagerTitleView = new ClipPagerTitleView(context);\r\n                clipPagerTitleView.setText(mDataList.get(index));\r\n                clipPagerTitleView.setTextColor(Color.parseColor(\"#000000\"));//默认文本颜色\r\n                clipPagerTitleView.setClipColor(Color.WHITE);//选中后文本颜色\r\n                clipPagerTitleView.setOnClickListener(new View.OnClickListener() {\r\n                    @Override\r\n                    public void onClick(View v) {\r\n                        mViewPager.setCurrentItem(index);\r\n                    }\r\n                });\r\n                badgePagerTitleView.setInnerPagerTitleView(clipPagerTitleView);\r\n\r\n                return badgePagerTitleView;\r\n            }\r\n\r\n            @Override\r\n            public IPagerIndicator getIndicator(Context context) {\r\n                LinePagerIndicator indicator = new LinePagerIndicator(context);\r\n                float navigatorHeight = context.getResources().getDimension(R.dimen.common_navigator_height_test);\r\n                float borderWidth = UIUtil.dip2px(context, 1);\r\n                float lineHeight = navigatorHeight - 2 * borderWidth;\r\n                indicator.setLineHeight(lineHeight);\r\n                indicator.setRoundRadius(lineHeight / 2);\r\n                indicator.setYOffset(borderWidth);\r\n                indicator.setColors(Color.parseColor(\"#f4ac29\"));//圆形颜色\r\n                return indicator;\r\n            }\r\n        });\r\n        magicIndicator.setNavigator(commonNavigator);\r\n        ViewPagerHelper.bind(magicIndicator, mViewPager);`\r\n\r\n如果text是中文，没有居中。。。"}}
{"actor":{"display_login":"chenwulue"}}