I am writing aplication for android 2.3
in main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android = "http://schemas.android.com/apk/res/android"
android:orientation = "vertical"
android:layout_width = "fill_parent"
android:layout_height= "fill_parent" >
<ListView
android:id = "@android:id/list"
android:textSize = "4sp"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
android:drawSelectorOnTop = "false" />
</LinearLayout>
in ViewHolder.java
public class ViewHolder {
ImageView icon = null;
ViewHolder(View base){
this.icon = (ImageView)base.findViewById(R.id.pic);
}
}
in ViewHolderDemo.java
public class ViewHolderDemo extends ListActivity {
private static final String[] items = {"lorem", "ipsum", "dolor", "sit", "amet","consectetuer", "adipiscing", "elit"};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setListAdapter(new IconicAdapter());
}
public void OnListItemClick(ListView parent, View v, int position, long id){
}
class IconicAdapter extends ArrayAdapter<String> {
public IconicAdapter() {
super(ViewHolderDemo.this, R.layout.row, R.id.label, items);
}
public View getView(int position, View convertView, ViewGroup parent){
View row = super.getView(position, convertView, parent);
ViewHolder holder = (ViewHolder)row.getTag();
if(holder == null){
holder = new ViewHolder(row);
row.setTag(holder);
}
holder.icon.setImageResource(R.drawable.star);
return(row);
}
}
}
problem that tired me is : when i changeandroid:textSize
in .xml
. size of text dont change
may be this is a bug in android
so how i can chage size of text(make small) that exist in ListView?