我在滚动滚动视图时使用此代码将alpha和字体设置为我的操作栏视图。
int upId = Resources.getSystem().getIdentifier("icon", "id", "android");
if (upId > 0) {
ImageView up = (ImageView) findViewById(upId);
up.setImageResource(R.drawable.ic_launcher);
}
int titleId = getResources().getIdentifier("action_bar_title", "id", "android");
abTitle = (TextView) findViewById(titleId);
abTitle.setTextColor(Color.BLACK);
abTitle.setAlpha(0);
abTitle.setTypeface(tf);
在你提问之前:我这样做是因为我想让我的应用程序保持最低的sdk。
答案 0 :(得分:0)
解决方案:
logo = getResources().getDrawable(R.drawable.logo_degradee);
logo.setAlpha(0);
getActionBar().setLogo(logo);
更容易预期