listview

Android Categorized listview with heading

老子叫甜甜 提交于 2020-02-02 03:43:25
问题 I have to display data from the database in a listview. I have fetch all the data in group by categoty and displayed in a Listview. I have used the following code. private ListView infos; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ......... ......... infos = new ListView(this); model = infoDataHelper.getCursor(addType); adapter = new InfoAdapter(model); infos.setAdapter(adapter); ......... ......... } class InfoAdapter extends CursorAdapter

Get First Visible Item in WPF ListView C#

风流意气都作罢 提交于 2020-02-02 03:19:29
问题 Anyone know how to get a ListViewItem by grabbing the first visible item in the ListView? I know how to get the item at index 0, but not the first visible one. 回答1: This was so painful to get working: HitTestResult hitTest = VisualTreeHelper.HitTest(SoundListView, new Point(5, 5)); System.Windows.Controls.ListViewItem item = GetListViewItemFromEvent(null, hitTest.VisualHit) as System.Windows.Controls.ListViewItem; And the function to get the list item: System.Windows.Controls.ListViewItem

ListView styling in JavaFX

烂漫一生 提交于 2020-02-02 03:14:06
问题 I have a listview. I want to change the color of the background and the text fill. I have tried doing the following: playlistView.setStyle("-fx-background-color: blue; -fx-text-fill: black;"); But, this doesn't work. However, the following is working: playlistView.setStyle("-fx-font-size: 24px; -fx-font-family: 'SketchFlow Print';"); Can you please tell me how to get the background and text-fill to work? Thank you. 回答1: You can use the following CSS styles: .list-view .list-cell:even { -fx

ListView - Images shuffle while scrolling

久未见 提交于 2020-02-02 03:02:18
问题 I have a ListView with two TextViews and one ImageView. The images are loaded from the Internet and are cached by LruCache. While scrolling through the ListView the images are getting shuffled for a few seconds. Ther just shouldn't be any image until the right image is fully loaded. I found a few questions with the same problem but no one helped me :/. Here's my code: public class NewsAdapter extends BaseAdapter { private static LayoutInflater inflater; private List<Item> items = new

ListView ContextMenuStrip for column headers

百般思念 提交于 2020-02-01 08:50:29
问题 I display a different ContextMenuStrip when I right click the ListView column header, and another inside ListView. class ListViewExx : ListView { public ContextMenuStrip HeaderContextMenu { get; set; } int contextMenuSet = 0; protected override void WndProc(ref System.Windows.Forms.Message m) { base.WndProc(ref m); switch(m.Msg) { case 0x210: //WM_PARENTNOTIFY contextMenuSet = 1; break; case 0x21: //WM_MOUSEACTIVATE contextMenuSet++; break; case 0x7b: //WM_CONTEXTMENU if(contextMenuSet == 2 &

ListView ContextMenuStrip for column headers

半腔热情 提交于 2020-02-01 08:50:13
问题 I display a different ContextMenuStrip when I right click the ListView column header, and another inside ListView. class ListViewExx : ListView { public ContextMenuStrip HeaderContextMenu { get; set; } int contextMenuSet = 0; protected override void WndProc(ref System.Windows.Forms.Message m) { base.WndProc(ref m); switch(m.Msg) { case 0x210: //WM_PARENTNOTIFY contextMenuSet = 1; break; case 0x21: //WM_MOUSEACTIVATE contextMenuSet++; break; case 0x7b: //WM_CONTEXTMENU if(contextMenuSet == 2 &

Error: No resource found that matches the given name: attr 'listViewStyle'

时间秒杀一切 提交于 2020-02-01 08:21:31
问题 I am trying to theme my default listview theme. I have read a lot of stuff on the web and they are all saying this should work: <style name="Theme.MyTheme" parent="@style/Theme.Sherlock.Light"> <item name="textColor">@color/darkblue</item> <item name="listViewStyle">@style/MyListViewTheme</item> </style> with this theme for the ListView: <style name="MyListViewTheme" parent="@android:style/Widget.ListView"> <item name="android:textColor">@color/darkblue</item> <item name="android:typeface"

Error: No resource found that matches the given name: attr 'listViewStyle'

岁酱吖の 提交于 2020-02-01 08:20:12
问题 I am trying to theme my default listview theme. I have read a lot of stuff on the web and they are all saying this should work: <style name="Theme.MyTheme" parent="@style/Theme.Sherlock.Light"> <item name="textColor">@color/darkblue</item> <item name="listViewStyle">@style/MyListViewTheme</item> </style> with this theme for the ListView: <style name="MyListViewTheme" parent="@android:style/Widget.ListView"> <item name="android:textColor">@color/darkblue</item> <item name="android:typeface"

ListView Display and File to Uri

为君一笑 提交于 2020-02-01 00:25:56
How can adapter display the content of the listview. 1.AbsListView.java [cpp] view plain copy protected void onMeasure( int widthMeasureSpec, int heightMeasureSpec) { ....... final View child = obtainView(0, mIsScrap); ..... } //one item, called one time. 2.AbsListView.java [java] view plain copy View obtainView( int position, boolean [] isScrap) { .... child = mAdapter.getView(position, scrapView, this ); .... } 3.CursorAdapter.java [java] view plain copy public View getView( int position, View convertView, ViewGroup parent) { ..... if (convertView == null ) { v = newView(mContext, mCursor,

How to add list items to a ListView in C#winform?

偶尔善良 提交于 2020-01-31 19:15:33
问题 I have a list of objects. I want to add these items to a ListView. I'm trying to add each list item row wise but format is very bad, it should be in proper table type format. List<string> lst = new List<string>(); lst.Add("John dsfsfsdfs " + "1" + 100); lst.Add("Smith sdfsdfsdfs" + "2" + 120); lst.Add("Cait dsffffffffffffffffffffff" + "3" + 97); lst.Add("Irene" + "4" + 100); lst.Add("Ben" + "5" + 100); lst.Add("Deniel jjhkh " + "6" + 88); foreach(string pl in lst) { listView1.Items.Add(pl); }