当我运行bundle install时,我无法在我的OSX上安装此gem。这是日志:
public class ViewPagerAdapter extends FragmentPagerAdapter {
int NumbOfTabs = 4; // Store the number of tabs, this will also be passed when the ViewPagerAdapter is created
String[]tabs;
CharSequence Titles[]={"P","M","C","S","I"};
int icons[]={R.drawable.profile,R.drawable.match,R.drawable.chat,R.drawable.ic_search,R.drawable.info};
Context context;
public ViewPagerAdapter(FragmentManager fm, Context mContext) {
super(fm);
this.context= mContext;
tabs = context.getResources().getStringArray(R.array.tabs);
}
@Override
public Fragment getItem(int position) {
switch (position){
case 0:
Profile Profile = new Profile();
return Profile;
case 1:
MatchPage MatchPage = new MatchPage();
return MatchPage;
case 2:
Chat Chat = new Chat();
return Chat;
case 3:
SearchPreference SearchPreference = new SearchPreference();
return SearchPreference;
case 4:
Info Info = new Info();
return Info;
}
return null;
}
@Override
public CharSequence getPageTitle(int position) {
Drawable drawable=context.getResources().getDrawable(icons[position]);
drawable.setBounds(0, 0,100,100);
ImageSpan imageSpan = new ImageSpan(drawable);
SpannableString spannableString =new SpannableString(" ");
spannableString.setSpan(imageSpan,0,spannableString.length(),spannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
return spannableString;
//return Titles[position];
}
@Override
public int getCount() {
return NumbOfTabs;
}
我安装了很多次但没有成功。这里有人有这个问题吗?