リストに実際の項目がない場合、コードで ListViewItem の高さを取得する方法はありますか?
私の ListViewItem レイアウト:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight">
...
</LinearLayout>
Inflater を使用して取得しようとしました:
View convertView = LayoutInflater.from( this )
.inflate( R.layout.mail_list_row, null );
int itemHeight = convertView.getHeight();
しかし、それは戻り値 0 です。
ありがとう!