Android 缩放listview行中的文本
我会在单击按钮时增加listview的大小,但当单击按钮时,某些listview项目的textview大小将保持默认值,并且不会根据需要更改。有什么想法吗?下面是我在listview中增加字体大小的一段代码Android 缩放listview行中的文本,android,android-listview,Android,Android Listview,我会在单击按钮时增加listview的大小,但当单击按钮时,某些listview项目的textview大小将保持默认值,并且不会根据需要更改。有什么想法吗?下面是我在listview中增加字体大小的一段代码 int count = mlist.getChildCount(); if (zoom_counter==1){ for(int i=0;i<count;i++){ Button textTab=(Button)mlist.getChildAt(i).find
int count = mlist.getChildCount();
if (zoom_counter==1){
for(int i=0;i<count;i++){
Button textTab=(Button)mlist.getChildAt(i).findViewById(R.id.myButton);
// if your control is not textview, use your correct one
textTab.setTextSize(TypedValue.COMPLEX_UNIT_DIP,16f);
efficientadapter.notifyDataSetChanged();
}
}
int count=mlist.getChildCount();
如果(缩放计数器==1){
对于(int i=0;i如何将字体大小作为静态变量放入适配器类内的变量中。然后调用notifydatasetchanged,更改适配器内文本视图的一侧。textTab.setTextSize(TypedValue.COMPLEX\u UNIT\u DIP,16f);其工作原理,似乎是您在犯其他错误