| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by Administrator on 2016/10/17. |
| | | */ |
| | | public class MyFragmentPagerAdapter extends FragmentPagerAdapter { |
| | | |
| | | private final List<Fragment> mFragments = new ArrayList<>(); |
| | |
| | | |
| | | @Override |
| | | public CharSequence getPageTitle(int position) { |
| | | // return mFragmentTitles.get(position); |
| | | return null; |
| | | |
| | | // Drawable image = context.getResources().getDrawable(R. mipmap.ic_launcher); |
| | | //// image.setBounds(0, 0, image.getIntrinsicWidth()/2, image.getIntrinsicHeight()/2); |
| | | // image.setBounds(0, 0, image.getIntrinsicWidth()/2, image.getIntrinsicHeight()/2); |
| | | // ImageSpan imageSpan = new ImageSpan(image, ImageSpan.ALIGN_BOTTOM); |
| | | // SpannableString ss = new SpannableString("嘿嘿"); |
| | | // ss.setSpan(imageSpan, 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | | // return ss; |
| | | } |
| | | public View getTabView(int position){ |
| | | View view = LayoutInflater.from(context).inflate(R.layout.activity_main_tab,null); |
| | |
| | | mImgIcon.setImageResource(mFragmentIcons.get(position)); |
| | | return view; |
| | | } |
| | | |
| | | } |