图像灰度CSS效果

时间:2016-02-01 14:46:13

标签: html css3

我想用CSS缩小图像的public void fillFormules(List<Category> objectsTextToShow) { LinearLayout layoutItemDetail = (LinearLayout) view.findViewById(R.id.layoutItemDetail); LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.mygallery); linearLayout.removeAllViews(); for (int j = 0; j <objectsTextToShow.size() ; j++) { ScrollView scrollView = new ScrollView(getActivity()); scrollView.setBackgroundColor(android.R.color.transparent); scrollView.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); for (int i = 0; i < objectsTextToShow.get(j).getItems().size(); i++) { LinearLayout separator = new LinearLayout(getActivity()); LayoutParams separatorParams = new LayoutParams(LayoutParams.MATCH_PARENT, 80); TextView textView = new TextView(getActivity()); LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); textView.setBackgroundColor(colorUtils.titleColor); textView.setLayoutParams(layoutParams); //textView.setTypeface(FONT_TITLE); textView.setTextSize(28); textView.setText(Check.Languages(objectsTextToShow.get(j).getItems().get(i).getName(), LANGUAGE_ID)); separator.setLayoutParams(separatorParams); linearLayout.addView(separator); linearLayout.addView(textView); scrollView.addView(linearLayout); } layoutItemDetail.addView(scrollView); } // scrollView.addView(linearLayout); }

我正在使用Mozilla Firefox,这是我的代码:

brightness

为什么没有生效?

2 个答案:

答案 0 :(得分:1)

img {
  -webkit-filter: brightness(100%);
  -moz-filter: brightness(100%);
  filter: brightness(100%);
}
img:hover {
  -webkit-filter: brightness(50%);
  -moz-filter: brightness(50%);
  filter: brightness(50%);
}

这就是你所需要的!我检查了Firefox和Chrome,代码正在工作中 jsfiddle-link

答案 1 :(得分:1)

library("neuralnet")