I'm using one from the built-in list item layout in my app.
I want to change the style of this list like text color or size of text .
I'm using simple_list_item_1 from these items .
Can you help me how I can do that.
You should make a custom Layout and inflate it in getView() method of Adapter.
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = getLayoutInflater();
View row;
row = inflater.inflate(R.layout.custom, parent, false);
TextView title, detail;
ImageView i1;
title = (TextView) row.findViewById(R.id.title);
detail = (TextView) row.findViewById(R.id.detail);
i1=(ImageView)row.findViewById(R.id.img);
title.setText(Title[position]);
detail.setText(Detail[position]);
i1.setImageResource(imge[position]);
return (row);
}
you can look into this thing more on Custom Listview
and from my personal opinion you can use RecyclerView for better Customisation.
Do you mean in the Android Studio preview?
If so, tools:listitem="@layout/list-item-layout"
is your friend.
Create your own layout and place it in your app layout directory and refer that in your code instead of simple_list_item_1
Example here
R.layout.<yourLayoutName>
instead of
android.R.layout.simple_list_item_1
And customize the layout as you like it!!