QuestionFragment.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:StudyBox_Android 作者:
private void initPromptSwitcher() {
    promptTextSwitcher.setFactory(new ViewSwitcher.ViewFactory() {
        @Override
        public View makeView() {
            TextView textView = new TextView(getActivity());
            int padding = getResources().getDimensionPixelOffset(R.dimen.prompt_padding);
            FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
                    FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.MATCH_PARENT);
            params.gravity = Gravity.CENTER;
            textView.setLayoutParams(params);
            textView.setGravity(Gravity.CENTER);
            textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.exam_small_text));
            textView.setPadding(padding, padding, padding, padding);
            textView.setMovementMethod(new ScrollingMovementMethod());
            textView.setVerticalScrollBarEnabled(true);
            return textView;
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号