For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/lynx-native-api/lynx-view/update-viewport.md.
Lynx
  • English
  • updateViewport

    The client updates the LynxView view size.

    Syntax

    Android

    public void updateViewport(int widthMeasureSpec, int heightMeasureSpec);

    Parameters

    • widthMeasureSpec: Current LynxView width.
    • heightMeasureSpec: Current LynxView height.

    iOS

    - (void)updateViewportWithPreferredLayoutWidth:(CGFloat)preferredLayoutWidth
                             preferredLayoutHeight:(CGFloat)preferredLayoutHeight
                                        needLayout:(BOOL)needLayout;

    Parameters

    • preferredLayoutWidth: Current LynxView width.
    • preferredLayoutHeight: Current LynxView height.
    • needLayout: Whether layout needs to be triggered.

    Desktop (C++)

    Desktop public API uses SetFrame(...) for the view rectangle, and exposes UpdateScreenMetrics(...) separately for screen metrics.

    void SetFrame(float x, float y, float width, float height);

    Parameters

    • x: The x coordinate of the LynxView.
    • y: The y coordinate of the LynxView.
    • width: Current LynxView width.
    • height: Current LynxView height.

    Compatibility

    LCD tables only load in the browser

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.