alibaba / rax

🐰 Rax is a progressive framework for building universal application. https://rax.js.org
Other
8k stars 627 forks source link

[Question] aspectFill在web下不生效 #2281

Closed waylon-gmail closed 2 years ago

waylon-gmail commented 2 years ago
      <Slider className="slider" height={'180px'} activeIndex={activeIndexState} autoplay infinite onChange={handleChange}>
        {menuList.map((item, index) => {
          return (
            <Slider.Item key={item.id}>
              <View className="slide-image-cont" onClick={() => handleItemClick(index)}>
                <Image
                  className="slide-image"
                  mode="aspectFill"
                  source={{
                    uri: item.iconUrl,
                  }}
                />
              </View>
            </Slider.Item>
          );
        })}
      </Slider>
waylon-gmail commented 2 years ago

image web下会被压扁。 小程序下没有问题。

fengzilong commented 2 years ago

image

mode 仅支持小程序,web 需要单独处理下,可以试下 mode + resizeMode