items

Items in listView have white text when using setAdapter in UI thread

女生的网名这么多〃 提交于 2019-12-01 03:28:38
For another listView in another activity the text color of the items is black, like it should be. However, in another activity when using setAdapter in a new thread when the new items created the text color is white when I want it black. Here is the contents of Layout and Java code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="project.yemeb.Search" android:background="#ffffffff"> <RelativeLayout android:layout_width="fill_parent"

Display custom content for a custom account menu item in Woocommerce 3

我与影子孤独终老i 提交于 2019-12-01 01:43:37
I am trying to display a custom notice in my custom account menu element based on user total purchased amount in Woocommerce, based on this answer code: Custom cart notice based on user total purchased amount in Woocommerce It does not work as I would like. What I am doing wrong? This is the code that I use: add_filter ( 'woocommerce_account_menu_items', 'xu', 40 ); function xu( $menu_links ){ $menu_links = array_slice( $menu_links, 0,3 , true ) + array( 'xu' => 'Xu của bạn' ) + array_slice( $menu_links, 3, NULL, true ); return $menu_links; } add_action( 'init', 'add_endpoint' ); function add

android: Identify individual items in row of ListView?

房东的猫 提交于 2019-11-29 23:08:10
问题 I have a ListView in a ListActivity populated by a database table. Each row of the ListView is a RelativeLayout with three TextViews named rowid, date, and name in that order. I am able to select individual rows programmatically using the .setSelection(int position) method of the ListView. Here is what I'm trying to do: When I push a button on the interface, get the rowid from the currently selected list row, and perform a db query using the rowid. I can't figure out how to get the rowid from

WPF/Metro-style: Making ListView show only complete items

坚强是说给别人听的谎言 提交于 2019-11-29 15:43:29
In my Metro application, I have a data source containing a certain number of items (say 25). I have a ListView that presents those items. My problem is that the ListView have a size that allows it to display, say, 6.5 items, so that the last item it displays is cut in half. If the resolution changes, it might display 4 items, or 8.2 items, or whatever. What I'd like is that the ListView shows exactly the number of items that fits in the height of the control, instead of clipping the last item. Right now, I see two possible half-solutions, none of which is optimal: Set the height of the

How do I find an item by value in an combobox in C#?

╄→гoц情女王★ 提交于 2019-11-29 11:26:14
问题 In C#, I have variable, a , of type string . How do I find item by value of a in combobox (I want find item with value no display text of combobox). 回答1: You can find it by using the following code. int index = comboBox1.Items.IndexOf(a); To get the item itself, write: comboBox1.Items[index]; 回答2: You should see a method on the combo box control for FindStringExact(), which will search the displaymember and return the index of that item if found. If not found will return -1. //to select the

Bound combobox items refers to different field items

*爱你&永不变心* 提交于 2019-11-28 14:23:44
I got a bounded combobox to a group name in vb.net. i can view in the drop down items of the combobox the set of GROUP NAMES. but when i do an insert or update query, i need to make the selected group name refers to the GROUP NUMBER. I don't want to store letters in the database, instead i prefer numbers. how can i do that?! Here is my code so far : cmd1.Parameters.AddWithValue("@group", DirectCast(Additemcombobox.SelectedItem, DataRowView).Item("GroupName")) Storing the group name in database is currently working well. My question might not be well explained. Please ask me in case... any help

How to change the appearance of a MenuStrip [duplicate]

旧城冷巷雨未停 提交于 2019-11-27 21:41:09
This question already has an answer here: How to change menu hover color 4 answers I add a MenuStrip in my app and is add on ManagerRenderMode at Render Mode . The problem is with the appearance, look offal. Look at those two photos, I want to change that white border of submenus in transparent, that blue rectangule that look offal on gray for the menu and for the submenu in dark gray (and his border that is a dark blue) and the border white of menu when is selected. How I can do this ? BackColor is: 36; 36; 36 and ForeColor is LightGray . I managed to change the blue rectangle, the white

Modification of the list items in the loop (python) [duplicate]

拈花ヽ惹草 提交于 2019-11-27 18:22:14
This question already has an answer here: How to modify list entries during for loop? 8 answers I'm trying to modify items in a list using a for loop, but I get an error (see below). Sample code: #!/usr/bin/env python # *-* coding: utf8 *-* data = [] data.append("some") data.append("example") data.append("data") data.append("here") for item in data: data[item] = "everything" Error: Traceback (most recent call last): File "./testy.py", line 11, in <module> data[item] = "everything" TypeError: list indices must be integers, not str Is there any way to solve this problem? Try this instead: for i

Programmatically Check an Item in Checkboxlist where text is equal to what i want

北城余情 提交于 2019-11-27 05:45:16
问题 In C#, I am trying to Check an item in a CheckBoxList where the text equals what I require. I would modify the code to check items that exist in the database. If you would like an example, i need to select the checklistbox item that equals to abc 回答1: Assuming that the items in your CheckedListBox are strings: for (int i = 0; i < checkedListBox1.Items.Count; i++) { if ((string)checkedListBox1.Items[i] == value) { checkedListBox1.SetItemChecked(i, true); } } Or int index = checkedListBox1

Populating a listview from a SQLite database

爷,独闯天下 提交于 2019-11-27 02:27:50
问题 I have an activity where i write a name which is insert in the database. In another activity I want to put a ListView which is populated with those names which are in the database or to add the new item directly when i write it in the edittext from the first activity. I realized the insert into database part but i can't figure out how to populate that listview. public class Add extends Activity implements OnClickListener{ Button sqlUpdate; EditText sqlName; @Override protected void onCreate