UITabBarItem设置的图片选中状态下默认的是蓝色,如何改变它的颜色为图片自带的颜色呢? typedef NS_ENUM(NSInteger, UIImageRenderingMode) { // 使用图像的上下文中使用的默认渲染模式,使用默认的蓝色 UIImageRenderingModeAutomatic, // Use the default rendering mode for the context where the image is used // 总是画出
1.用代码设置控件的颜色: int b = getResources().getColor(R.drawable.blue);//得到配置文件里的颜色 mButton.setTextColor(b); 2.设置空间的字体: 方式一:mText.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/HandmadeTypewriter.ttf"));//设置字体 注意:1.保证文件一定是ttf格式:2.放到