codecamp

高亮触摸

一个包装器是为了让视图对触发做出合适的响应。按下按钮,包装后的视图的透明性就会降低,这样底衬的颜色就会显示出来,使视图颜色变暗或者着色。底衬的出现是因为向视图层次结构添加了一个视图,如果使用不正确的话,这有时候会导致不必要的认为视觉效果,例如,如果包装了的视图的背景颜色不是很明确的设置成一个不透明的颜色。

例子:

renderButton: function() {  return (
    <TouchableHighlight onPress={this._onPressButton}>
      <Image
        style={styles.button}
        source={require('image!myButton')}
      />
    </TouchableHighlight>
  );
},

属性

Edit on GitHub

TouchableWithoutFeedback props...

activeOpacity 数值型

当触发处于活跃状态时,确定包装后的使徒的不透明度。

style View#style

underlayColor 字符串型

当触发处于活跃状态时,底衬的颜色会显示出来。



ToolbarAndroid
不透明触摸
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }