问题标签 [nativemethodsmixin]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - React Native - 如何测量 ScrollView 中内容的大小?
我想测量我的ScrollView.
因此,我使用measurefrom NativeMethodsMixin:
我不太确定从这里去哪里,与此问题相关的大多数 SO 帖子似乎都已过时。
我知道我需要为ref我创建一个ScrollView(我做了并调用_scrollView了它,我可以使用它来访问它this.refs._scrollView)。
问题是,我不能像这样this.refs._scrollView传入measure:
然后我收到以下错误:
然后我尝试检索实际的节点句柄findNodeHandle,并将其传递measure到此github 问题中讨论的内容:
但这会导致相同的错误。有任何想法吗?
react-native - 测量 react-native ref (ListView) 的高度
如果您只有 ,如何测量反应原生元素的高度ref?
我看到了NativeMethodsMixin,但不清楚如何实现它。
我尝试将其包括为:
但该应用程序抱怨NativeMethodsMixin未定义。
如果我走的RCTUIManager路线:
然后我得到一个错误:Uncaught TypeError: Converting circular structure to JSON
我只是想得到那个高度ref。我错过了什么?