Chr*_*sco 4 android android-listview
我需要检查子类的属性是否具有Viewa的wrap_content固定值,如何以编程方式执行此操作?android:layout_heightListViewAdapter
PS:这是为了做这样的事情:
// Pseudo code
If attribute = wrap_content Then
    calculateViewHeight();
Else 
    // If it was fixed, do nothing
End if
不,我不能 Override onMeasure()
尝试这个:
ViewGroup.LayoutParams lp = view.getLayoutParams();
if(lp.height == ViewGroup.LayoutParams.WRAP_CONTENT) {
    //do something
} else {
    //fixed height.
}
| 归档时间: | 
 | 
| 查看次数: | 1338 次 | 
| 最近记录: |