ITeye博客

安卓布局设置背景色处理

corelengine · 2016-09-27 09:27 · 移动开发 · Markdown

RelativeLayout dls_layout = (RelativeLayout) view.findViewById(R.id.dls_layout); if (userInfo != null&&"0".equals(userInfo.getIscandls())) {

		dls_layout.setClickable(true);
		dls_layout.setOnClickListener(this);
	}else{
		dls_layout.setClickable(false);

// dls_layout.setBackgroundColor(R.color.main_color);//不可用

		dls_layout.setBackgroundColor(getResources().getColor(R.color.unclickablegray));
		 
	}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。