我正在给布局充气并尝试获取视图的高度。这是我的代码。它总是返回0
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.layout_name, null);
RelativeLayout item = (RelativeLayout) view.findViewById(R.id.temp_relative_main_);
int temp_height=item.getHeight();
int temp_width=0;
Log.d("temp_height","temp_height " + temp_height);