問題:
Is it possible to get the size (width and height) of a certain view?是否可以獲取某個視圖的大小(寬度和高度)? For example, I have a view showing the progress:例如,我有一個顯示進度的視圖:
<View ref='progressBar' style={{backgroundColor:'red',flex:this.state.progress}} />
I need to know the actual width of the view to align other views properly.我需要知道視圖的實際寬度才能正確對齊其他視圖。 Is this possible?這可能嗎?
解決方案:
參考一: https://en.stackoom.com/question/22jDe參考二: https://stackoom.com/question/22jDe