listitem

Click ImageView within a ListView ListItem and get the position?

ε祈祈猫儿з 提交于 2019-11-28 10:18:40
Currently, when the ListItem is clicked I grab its position and pass it to my StopsScheduleActiviy. I would like to detect when the ImageView of that ListItem is clicked so that I can launch my MapActivity instead and pass it the position. Basically: Click the ImageView launch MapsActivity, otherwise click anywhere else on ListItem launch StopsScheduleActivity. In Both cases I need the position. How can I do this? Here is my current onItemClick listener. @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent myIntent = new Intent(this,

Customize list item bullets using CSS

吃可爱长大的小学妹 提交于 2019-11-27 17:08:13
问题 Is it possible to change the size of an <li> element's bullet ? Take a look at the code below: li { list-style: square; // I want to change the size of this squared bullet. } I can't seem to find any way to achieve that. 回答1: You mean altering the size of the bullet, I assume? I believe this is tied to the font-size of the li tag. Thus, you can blow up the font-size for the LI, then reduce it for an element contained inside. Kind of sucks to add the extra markup - but something like: li {font

Databind ASP.NET List of ListItem to DropDownList issue

心已入冬 提交于 2019-11-27 12:47:35
问题 I've just come across this bizarre thing that I was expecting to work in a different (logical) way, but it doesn't. Is it a bug or a "feature"? So there's a DropDownList that I'm populating in the codebehind with a List of ListItem. Each new ListItem gets 2 arguments that, according to the intellisense-provided documentation, correspond to its text and value: List<ListItem> users = new List<ListItem>(); foreach (SubscriptionUser su in subscriptionDetails.UserList) { users.Add(new ListItem(su

Click ImageView within a ListView ListItem and get the position?

风格不统一 提交于 2019-11-27 03:32:05
问题 Currently, when the ListItem is clicked I grab its position and pass it to my StopsScheduleActiviy. I would like to detect when the ImageView of that ListItem is clicked so that I can launch my MapActivity instead and pass it the position. Basically: Click the ImageView launch MapsActivity, otherwise click anywhere else on ListItem launch StopsScheduleActivity. In Both cases I need the position. How can I do this? Here is my current onItemClick listener. @Override public void onItemClick

Get listview item position on button click

巧了我就是萌 提交于 2019-11-26 20:24:06
This is my listview click event: lv1.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, int position, long id) { Object o = lv1.getItemAtPosition(position); ItemDetails obj_itemDetails = (ItemDetails)o; Toast.makeText(ListViewImagesActivity.this, "You have chosen : " + " " + obj_itemDetails.getName(), Toast.LENGTH_LONG).show(); } }); And this is my button click event: btnNxt = (Button) findViewById(R.id.btnNext); btnNxt.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { //Here I need to get that

ListItems attributes in a DropDownList are lost on postback?

喜欢而已 提交于 2019-11-26 16:07:21
A coworker showed me this: He has a DropDownList and a button on a web page. Here's the code behind: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ListItem item = new ListItem("1"); item.Attributes.Add("title", "A"); ListItem item2 = new ListItem("2"); item2.Attributes.Add("title", "B"); DropDownList1.Items.AddRange(new[] {item, item2}); string s = DropDownList1.Items[0].Attributes["title"]; } } protected void Button1_Click(object sender, EventArgs e) { DropDownList1.Visible = !DropDownList1.Visible; } On the page load, the items' tooltips are showing, but on the

Get listview item position on button click

时光毁灭记忆、已成空白 提交于 2019-11-26 08:53:26
问题 This is my listview click event: lv1.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, int position, long id) { Object o = lv1.getItemAtPosition(position); ItemDetails obj_itemDetails = (ItemDetails)o; Toast.makeText(ListViewImagesActivity.this, \"You have chosen : \" + \" \" + obj_itemDetails.getName(), Toast.LENGTH_LONG).show(); } }); And this is my button click event: btnNxt = (Button) findViewById(R.id.btnNext); btnNxt