ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.62k stars 2.39k forks source link

RN 0.4x 下 List.Item 带 onClick 时无点击高亮反馈 #793

Closed u0x01 closed 7 years ago

u0x01 commented 7 years ago

同时,样式显示也有异常,即使用 List 包裹 List.Item 时 Bottom 处会有两条线: simulator screen shot 2017 2 9 5 39 25

这个是 and-mobile 的 demo,经测试有反馈: img_2446

安卓下长按报错: wechatimg12

示例代码:

      <List>
        <List.Item
          thumb="https://zos.alipayobjects.com/rmsportal/UIqwcqpVsIjvyYZ.png"
          arrow="horizontal"
          onClick={() => {}}
        >H5 组件</List.Item>
        <List.Item
          thumb="https://zos.alipayobjects.com/rmsportal/lSsJiCJnOzSnBJG.png"
          arrow="horizontal"
          onClick={() => {}}
        >React Native 组件</List.Item>
      </List>
silentcloud commented 7 years ago

master 最新代码已经将 List.Item 内置的 touchable 移除了

u0x01 commented 7 years ago

@silentcloud 我自己试了下外面包一个 touchablehighlight 也不行啊

u0x01 commented 7 years ago

所以现在如果要加高亮反馈应该怎么做?

silentcloud commented 7 years ago

@u0x01 master 上的代码目前还没有发版本,所以应该是不生效的,要等个版本,或者发个 alpha?

u0x01 commented 7 years ago

@silentcloud 好的呀,发alpha版本分支我就可以直接拉了。 另外,tabbarItem 的 icon 渲染能不能加render函数,如果要用SVG图标的话用不了(另开issue?)

silentcloud commented 7 years ago

u0x01 RN svg 不行的,web (1.0)的是支持 svg 的

u0x01 commented 7 years ago

@silentcloud 所以我的意思是增加 renderIcon 这个参数,SVG可以自己去渲染。

silentcloud commented 7 years ago

@u0x01 RN(iOS) 目前是直接采用的 rn 官方的 TabBar,先暂时不增加,和官网一致

u0x01 commented 7 years ago

这样啊,那只能自己实现个tabbar了。主要在RN里面用图片会有延迟感。

silentcloud commented 7 years ago

@u0x01 离线图片怎么会有延迟感?本地资源

u0x01 commented 7 years ago

@silentcloud 部分低端 Android 机型会出现,即便关掉 Dev 模式

u0x01 commented 7 years ago

@silentcloud alpha 分支啥时候发呀 😬

silentcloud commented 7 years ago

@u0x01 稍等还在改,发现不能单纯去掉 flex 的 touchable,影响到其他组件了,我正在将内置的 touchableWithoutFeedback 切换成 Highlight ,稍等

u0x01 commented 7 years ago

感谢,公司新项目可以用上了 😄

silentcloud commented 7 years ago

@pingan1927 touchableWithoutFeedback 切换为 touchableHighLight,注意查看其他使用了 Flex 的组件(比如 Grid)

u0x01 commented 7 years ago

1.0.0-beta3 已修复。

pingan1927 commented 7 years ago

@silentcloud OK