Reputation: 389
I have 2 textviews and one imageview and i want to bind them into a single control so that i can implement horizontalScrollView on them...
Is there a way to merge different controls so that we can use them???
Or is there a way to implement horizontalScrollView on multiple controls simulataneously??
Thanks in advance
Upvotes: 2
Views: 162
Reputation: 9902
You can build an xml layout that you inflate into a GaleryView. Android allows you to build any mashup of controls into a layout and then use that layout for each row in a listview or each item in a sliding galery.
in a ListAdapter you can inflate the layout and set all of the properties.
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater factory = LayoutInflater.from(context);
View row = factory.inflate(R.layout.list_row, null);
TextView main = (TextView)row.findViewById(R.id.labelMain);
TextView details = (TextView)row.findViewById(R.id.labelDetails);
ImageView icon = (ImageView)row.findViewById(R.id.imgIcon);
main.setText(_items.get(position).Title);
details.setText(_items.get(position).Description);
icon.setImageResource(R.drawable.pin);
return row;
}
Upvotes: 1