Tencent/QMUI_Android · error · RuntimeException
More than one view in xml marked by qmui_layout_edge =
Error message
More than one view in xml marked by qmui_layout_edge =
What it means
QMUIPullLayout.onFinishInflate throws when two children in the XML declare the same qmui_layout_edge (top/right/bottom/left). Each pull edge may host at most one action view; the duplicated edge name is appended to the message.
Source
Thrown at qmui/src/main/java/com/qmuiteam/qmui/widget/pullLayout/QMUIPullLayout.java:137
if (isTargetSet) {
throw new RuntimeException(
"More than one view in xml are marked by qmui_is_target = true.");
}
isTargetSet = true;
setTargetView(view);
} else {
if ((edgesSet & lp.edge) != 0) {
String text = "";
if (lp.edge == PULL_EDGE_LEFT) {
text = "left";
} else if (lp.edge == PULL_EDGE_TOP) {
text = "top";
} else if (lp.edge == PULL_EDGE_RIGHT) {
text = "right";
} else if (lp.edge == PULL_EDGE_BOTTOM) {
text = "bottom";
}
throw new RuntimeException("More than one view in xml marked by qmui_layout_edge = " + text);
}
edgesSet |= lp.edge;
setActionView(view, lp);
}
}
}
@Override
public void computeScroll() {
if (mScroller.computeScrollOffset()) {
if (mScroller.isFinished()) {
if(mState == STATE_SETTLING_TO_INIT_OFFSET){
mState = STATE_IDLE;
return;
}
if(mState == STATE_TRIGGERING){
return;
}View on GitHub (pinned to 026e7d4866)
Solutions
- Ensure each qmui_layout_edge value (top/right/bottom/left) appears at most once among the direct children.
- Change the duplicated child to a different edge if you need actions on multiple sides.
- Remove the edge attribute from <include> roots that duplicate an already-declared edge.
Example fix
<!-- before --> <View app:layout_qmui_layout_edge="top"/> <View app:layout_qmui_layout_edge="top"/> <!-- after --> <View app:layout_qmui_layout_edge="top"/> <View app:layout_qmui_layout_edge="bottom"/>
Defensive patterns
Strategy: validation
Validate before calling
// ensure each edge is used at most once
Set<Integer> seen = new HashSet<>();
for (int i = 0; i < pullLayout.getChildCount(); i++) {
QMUIPullLayout.LayoutParams lp = (QMUIPullLayout.LayoutParams) pullLayout.getChildAt(i).getLayoutParams();
if (!lp.isTarget && !seen.add(lp.edge)) {
throw new IllegalStateException("duplicate qmui_layout_edge " + lp.edge);
}
} Try / catch
try {
setContentView(R.layout.pull_screen);
} catch (RuntimeException e) {
Log.e(TAG, "duplicate qmui_layout_edge in pull layout XML", e);
} Prevention
- Use each edge value (top/right/bottom/left) at most once among non-target children.
- Change the edge attribute when copy-pasting header/footer blocks.
- Check <include> roots for edge attributes that may duplicate existing children.
When it happens
Trigger: Declaring two children with the same app:qmui_layout_edge value (e.g. both "top"), including duplicates introduced via <include> layouts inflated into the pull layout.
Common situations: Copy-pasting an action-view block (header/footer) in XML without changing its edge attribute; merging layouts where an included root already declares the same edge.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- More than one view in xml are marked by qmui_is_target = tru
- Not support the type: %s
- topView must implement from IQMUIContinuousNestedTopView
- bottomView must implement from IQMUIContinuousNestedBottomVi
- delegateView must be a instance of View
AI-assisted analysis of Tencent/QMUI_Android@026e7d4866 (2026-09-06).
Data as JSON: /api/errors/3dc2d716cf386fb7.
Report an issue: GitHub.