ViewSizerStay organized with collectionsSave and categorize content based on your preferences.
Page Summary
ViewSizeris an interface used to control the size of aViewRenderablewithin a SceneformScene.
It provides a mechanism to calculate the desired size of an AndroidViewin meters for 3D placement.
The final rendered size is influenced by both theViewSizerand theNode's world scale.
getSize()is the core method, taking an AndroidViewand returning aVector3representing its dimensions in the scene.
Several pre-built implementations exist, likeFixedHeightViewSizer,FixedWidthViewSizer, andDpToMetersViewSizer, offering different approaches to sizing.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[],["The `ViewSizer` interface controls the size of a `ViewRenderable` within a `Scene`. Subclasses like `DpToMetersViewSizer`, `FixedHeightViewSizer`, and `FixedWidthViewSizer` determine size based on density-independent pixels per meter, fixed height, or fixed width in meters, respectively. `getSize(View view)` is the method for calculating the desired size of a view. The final displayed size is adjusted by the `getWorldScale()` of the attached `Node`. The method `getSize` return a vector representing the size in the scene, with x being the width and y the height.\n"]]