跪拜 Guibai
← All articles
Frontend · Android · iOS

19 Weex Rendering Bugs That Will Haunt Your Cross-Platform Build

By 勤劳勇敢的打工人 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Weex promises write-once-run-anywhere, but this list shows that promise has cracks: teams must build and test platform-specific workarounds for each feature, which multiplies maintenance cost and can slip into production as flickering UI, broken navigation, or invisible ellipsis marks.

Summary

Weex development runs into a wall of platform-specific rendering idiosyncrasies. The list covers CSS shorthand failures, layout bugs, timer quirks, and refresh component issues. Android forces explicit width/height on every div; iOS breaks overflow with box-shadow; HarmonyOS ignores ellipsis with nowrap. Workarounds range from wrapping elements in extra divs to slicing images for arrows.

The patterns are concrete: background shorthand is unusable, `border-radius` with four different values fails on iOS, and the `refresh` component cannot be dynamically shown or hidden. Several issues stem from how Weex maps CSS to native rendering on each platform, leaving developers to guess which properties behave where. The list also includes platform-specific traps like the Baidu app session reset and HarmonyOS image loading stalling after a translate plus transition-delay.

All 19 items are practical field notes, not theoretical warnings. Each one names a symptom and a fix, giving teams a checklist to consult before shipping Weex features. The recurring theme is that "write once, run anywhere" breaks down in the details — the only reliable path is to test every style and component on every target platform.

Takeaways
— Background shorthand is unsupported; use `background-color` and `background-image` separately.
— Android requires explicit width and height on every `div`; content-sized elements break positioning.
— Placing `text` at the same level as `flex:1` can lose styles; wrap it in a `div`.
— Baidu app H5 sessions reset during browsing, forcing users back to the login page.
— Upward loop scrolling sometimes freezes the first element.
— On Android, a stopped timer fails to restart; calling an empty timer after restart works.
— The `refresh` component cannot be dynamically toggled; change its layout instead.
— On iOS, clearing `background-image` via style requires setting `background-color` to `transparent`.
— iOS pull-to-refresh background only covers the height area; use an underlying layer.
— Android flashes when CSS and inline `style` both set the same property; remove the CSS rule.
— On iOS, `box-shadow` disables `overflow`.
— HarmonyOS and H5 fail to load image resources after `translate` plus `transition-delay` until user interaction.
— iOS components disappear after pull-back when the data difference is too large, caused by `key`.
— Android `transition` only supports a few style changes; wrap unsupported properties in a separate element.
— iOS `border-radius` with four different values is ignored; use image slicing or stacking.
— Weex web lacks the `richtext` component and tags.
— The four-border shorthand syntax fails on Android and iOS; slice images for arrows.
— HarmonyOS does not show ellipsis with `white-space: nowrap;` for single-line overflow.
Conclusions

The list is a direct symptom of Weex's rendering engine diverging from standard CSS across platforms, forcing developers to maintain a platform-aware mental model instead of a single component API.

Most items are silent at compile time and only appear at runtime, so without a shared pitfall register every new team member re-discovers the same bugs.

Concepts & terms
Weex
A cross-platform UI framework that compiles JavaScript and CSS into native components on Android, iOS, and web, aiming for write-once-run-anywhere development.
From the discussion

The article's claims get pushed back with precise Weex knowledge: font-weight applies only to text components and Android force-maps all weights to 400 or 700, so design's 500 Medium will always render thin. box-shadow is iOS-only by official docs, so it can't break overflow on Android, and white-space isn't a supported style at all—single-line ellipsis needs lines:1 plus parent-given width. Elsewhere the thread dismisses Weex as a decade-old stack, with one developer counting two years wasted on it.

— Font-weight is a text-style property that only works on text/input/richtext, not div; Android only accepts 400 and 700 and coerces all other numbers, so a 500 Medium design weight always renders thin and must instead be delivered by loading a Medium font-family.
— box-shadow is documented as iOS-only, so on Android it simply doesn't exist and can't 'break overflow'; that's intentional platform divergence, not a bug, and the Android fallback is to use an image.
— white-space isn't in Weex's supported style list, so setting it does nothing; single-line ellipsis requires lines:1 with text-overflow:ellipsis and a width from the parent, sharing the same root cause as the explicit-width/height rule.
— Several readers treat Weex as a dead, outdated stack; one says two years spent on it at a prior job were wasted and expects never to touch it again.
Featured comments
booboosui

The first item isn't 'may not work' — it definitely won't: font-weight in Weex belongs to text styles and only applies to text/input/richtext; div has no font concept. Also the docs say iOS supports all 9 weights from 100–900, while Android only recognizes 400 and 700, and any other number gets forced down to 400 or 700 — so the 500 Medium from design will always render too thin on Android; adjusting the number won't fix it, the only way is to load the Medium weight via font-family. Related counterexample: #12's box-shadow is an iOS-only property; the docs literally say 'currently only iOS is supported, Android is not supported yet', so the 'overflows invalidated' symptom simply won't appear on Android. It isn't an iOS bug, it's a difference in platform implementation; on the Android side the only way to get a shadow is to cut an image. #19 can also be rewritten: white-space isn't in Weex's supported style list (it never appears on the general styles page), so writing it is a no-op. Single-line ellipsis is lines:1 paired with text-overflow:ellipsis, and the width can only come from the parent container — which is actually the same root cause as #3's 'must have explicit width and height'.

勤劳勇敢的打工人

Wow, there are still pros—your company is still using this?

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗