在Android中以编程方式删除色调颜色

时间:2017-07-20 04:11:12

标签: android

我想以编程方式删除(重置)我已在XML布局中设置的ImageView 色调

1 个答案:

答案 0 :(得分:22)

我认为如果上面的东西不起作用,你可以尝试以编程方式再次将图像添加到imageview,同时以编程方式再次添加它不要为它设置tintcolor,它将用原始颜色充气

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
  <ul>{this.state.ListText}</ul>
  <span id='cont'>
            <svg width="100%" height="100%" viewBox="0 0 610 150" version="1.1">
                <defs>
                    <linearGradient x1="51.7971499%" y1="47.5635228%" x2="52.4921324%" y2="48.1654036%" id="linearGradient-1">
                        <stop stopColor="#9198A1" offset="0%"></stop>
                        <stop stopColor="#888D95" offset="100%"></stop>
                    </linearGradient>
                    <rect id="path-2" x="0" y="0" width="610" height="150" rx="7.2"></rect>
                </defs>
                <g id="Patient-Page" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
                    <g id="Desktop-HD" transform="translate(-732.000000, -106.000000)">
                        <g id="Medications" transform="translate(732.000000, 106.000000)">
                            <g id="Rectangle-7">
                                <use fillOpacity="0.55" fill="url(#linearGradient-1)" fillRule="evenodd" xlinkHref="#path-2"></use>
                            </g>
                            <text fontFamily="Helvetica" fontSize="32" fontWeight="normal" fill="#000000" >
                                <tspan x="165" y="39">Title Here</tspan>
                    
    
                            </text>
                       <foreignObject width="100" height="300"
                   requiredExtensions="http://www.w3.org/1999/xhtml">
                           <body xmlns="http://www.w3.org/1999/xhtml">
                               <p>Here is my list</p>
                           </body>
                       </foreignObject>
                        </g>
                    </g>
                </g>
            </svg>
            </span>
</div>
<script>
  var ul = $('<ul>');
  ["Item 1", "Item 2", "Item 3"].forEach(function(item) {
    ul.append($("<li>").text(item));

  });
  $('foreignObject').append(ul);
  $('foreignObject body').append(ul);
</script>

或者我认为这应该适合你。

    myImgView.setImageResource(R.drawable.yourDrwable);