{"action":"created","issue":{"url":"https://api.github.com/repos/H07000223/FlycoTabLayout/issues/112","repository_url":"https://api.github.com/repos/H07000223/FlycoTabLayout","labels_url":"https://api.github.com/repos/H07000223/FlycoTabLayout/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/H07000223/FlycoTabLayout/issues/112/comments","events_url":"https://api.github.com/repos/H07000223/FlycoTabLayout/issues/112/events","html_url":"https://github.com/H07000223/FlycoTabLayout/issues/112","id":200282583,"number":112,"title":"SegmentTabLayout segmentTab = new SegmentTabLayout(this);  on a null object reference","user":{"login":"LonelyMushroom","id":19225489,"avatar_url":"https://avatars.githubusercontent.com/u/19225489?v=3","gravatar_id":"","url":"https://api.github.com/users/LonelyMushroom","html_url":"https://github.com/LonelyMushroom","followers_url":"https://api.github.com/users/LonelyMushroom/followers","following_url":"https://api.github.com/users/LonelyMushroom/following{/other_user}","gists_url":"https://api.github.com/users/LonelyMushroom/gists{/gist_id}","starred_url":"https://api.github.com/users/LonelyMushroom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LonelyMushroom/subscriptions","organizations_url":"https://api.github.com/users/LonelyMushroom/orgs","repos_url":"https://api.github.com/users/LonelyMushroom/repos","events_url":"https://api.github.com/users/LonelyMushroom/events{/privacy}","received_events_url":"https://api.github.com/users/LonelyMushroom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-12T05:36:03Z","updated_at":"2017-01-16T06:40:42Z","closed_at":null,"body":">  SegmentTabLayout segmentTab = new SegmentTabLayout(this);\r\n\r\n\r\nAttempt to invoke interface method 'java.lang.String android.util.AttributeSet.getAttributeValue(java.lang.String, java.lang.String)' on a null object reference\r\n\r\n原因是\r\n\r\n> //get layout_height\r\n        String height = attrs.getAttributeValue(\"http://schemas.android.com/apk/res/android\", \"layout_height\");\r\n\r\n想问问作者我该如何用代码new出来"},"comment":{"url":"https://api.github.com/repos/H07000223/FlycoTabLayout/issues/comments/272784857","html_url":"https://github.com/H07000223/FlycoTabLayout/issues/112#issuecomment-272784857","issue_url":"https://api.github.com/repos/H07000223/FlycoTabLayout/issues/112","id":272784857,"user":{"login":"LonelyMushroom","id":19225489,"avatar_url":"https://avatars.githubusercontent.com/u/19225489?v=3","gravatar_id":"","url":"https://api.github.com/users/LonelyMushroom","html_url":"https://github.com/LonelyMushroom","followers_url":"https://api.github.com/users/LonelyMushroom/followers","following_url":"https://api.github.com/users/LonelyMushroom/following{/other_user}","gists_url":"https://api.github.com/users/LonelyMushroom/gists{/gist_id}","starred_url":"https://api.github.com/users/LonelyMushroom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LonelyMushroom/subscriptions","organizations_url":"https://api.github.com/users/LonelyMushroom/orgs","repos_url":"https://api.github.com/users/LonelyMushroom/repos","events_url":"https://api.github.com/users/LonelyMushroom/events{/privacy}","received_events_url":"https://api.github.com/users/LonelyMushroom/received_events","type":"User","site_admin":false},"created_at":"2017-01-16T06:40:42Z","updated_at":"2017-01-16T06:40:42Z","body":"@H07000223 嗯嗯 我就是按照你那样弄的\r\n\r\n> <?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<com.flyco.tablayout.SegmentTabLayout\r\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    xmlns:tl=\"http://schemas.android.com/apk/res-auto\"\r\n    android:id=\"@+id/tl_1\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"32dp\"\r\n    tl:tl_bar_color=\"@color/orange_style\"\r\n    tl:tl_indicator_color=\"@color/white\"\r\n    tl:tl_indicator_corner_radius=\"5dp\"\r\n    tl:tl_tab_padding=\"20dp\"\r\n\r\n    tl:tl_indicator_margin_bottom=\"0dp\"\r\n    tl:tl_indicator_margin_left=\"0dp\"\r\n    tl:tl_indicator_margin_right=\"0dp\"\r\n    tl:tl_indicator_margin_top=\"0dp\"\r\n\r\n    tl:tl_textSelectColor=\"@color/orange_style\"\r\n\r\n    android:layout_centerVertical=\"true\"\r\n    android:layout_centerHorizontal=\"true\"\r\n\r\n    tl:tl_tab_space_equal=\"true\"\r\n    tl:tl_indicator_anim_enable=\"false\"\r\n    tl:tl_indicator_bounce_enable=\"false\"\r\n\r\n    tl:tl_divider_width=\"0dp\"\r\n    />\r\n\r\n> SegmentTabLayout tab = (SegmentTabLayout) LayoutInflater.from(context).inflate(R.layout.tablayout_segment_qq, rlCenter, false);\r\n        rlCenter.addView(tab);\r\n        String[] titles = initialData(segmentLists);\r\n        tab.setTabData(titles);\r\n        tab.setCurrentTab(index);\r\n        tab.setOnTabSelectListener(new OnTabSelectListener() {\r\n            @Override\r\n            public void onTabSelect(int position) {\r\n                webView.callHandler(\"Click Segment Item\", String.valueOf(position), new CallBackFunction() {\r\n                    @Override\r\n                    public void onCallBack(String data) {\r\n\r\n                    }\r\n                });\r\n            }\r\n\r\n            @Override\r\n            public void onTabReselect(int position) {\r\n\r\n            }\r\n        });\r\n\r\n这样就可以了,布局也没问题,很棒.但是有个问题就是我调用setCurrentTab这个方法指定选中哪个标签时,不会触动我之前设置的监听,比如说\r\n\r\n> controller.addTabItemClickListener(new OnTabItemSelectListener() {\r\n            @Override\r\n            public void onSelected(int position, Object tag) {\r\n//                showHideFragment(mFragments[position], mFragments[mCurrentPosition]);\r\n                showHideFG(mFragments[position], mFragments[mCurrentPosition]);\r\n                mCurrentPosition = position;\r\n            }\r\n\r\n            @Override\r\n            public void onRepeatClick(int index, Object tag) {\r\n                return;\r\n            }\r\n        });\r\n\r\n> controller.setSelect(mCurrentPosition);\r\n\r\n我下面这句setSelect就是调用onSelected方法,你觉得有必要这样做吗?"}}
{"actor":{"display_login":"LonelyMushroom"}}