listview

Flutter. Set ListView initial position on an very large ListView

为君一笑 提交于 2020-03-26 06:29:16
问题 I want to create an almost infinite list of element, but I want to set the initial position of the list to some specific element. Something like this image: Where index 0 would be the initial position, and this list may or may not extend very long in both directions. I can create my elements like: Widget build_tile(int i){ return Container(child:Text(i.toString())); } and my list would be something like this ListView.builder( itemBuilder: (context, i) { return build_tile(i-offset); },

Custom listView android fails

ぃ、小莉子 提交于 2020-03-26 04:49:12
问题 so I have made a List view, called it "neighborhood". it supposed to show a list of names of houses, number, and their passwords. for it, I have made a layout with 3 textviews. the three lists that CustomAdapter class gets are from SQL, which works(i debugged it and it gets 3 full lists) EDIT: now it just fails, and it gives me this error. I have changed the code to the suggested answers, and it fixed the last problems the list: <ListView android:id="@+id/neighborhood" android:layout_width=

C# - How to use ListView and SQLite database

北城余情 提交于 2020-03-26 04:07:32
问题 I'm trying to add some data from a SQLite database, inside a ListView. I'm having some difficulties as I want to insert all the data of the column and not a single record. TEST CODE: Form1.cs {Load} private void home_form_Load(object sender, EventArgs e) { listView1.Refresh(); listView1.View = View.Details; listView1.Columns.Add("ID"); listView1.Columns.Add("Grado"); listView1.Columns.Add("Cognome"); listView1.Columns.Add("Nome"); listView1.Columns.Add("Status"); } Form1.cs {menu_button

How can i put a list to array

本秂侑毒 提交于 2020-03-25 17:53:32
问题 How can i put a list of strings, type string in String countryList[] = {a}; a is the variable that have the list so, it will be String countryList[] = {"heyyesGabon","heyyesGibraltar","heyyesGuinea"}; //and the others this list comes from console.log in javascript it always save the last item 回答1: From List to String array String [] countryArray = countryList.toArray(new String[0]); From String array to List List<String> list = Arrays.asList(array); 回答2: You can use in-build function list

Android SQLite数据库使用 学习与代码实践

徘徊边缘 提交于 2020-03-25 07:26:17
Android SQLite数据库使用 学习与代码实践 SQLiteOpenHelper 类   用 SQLiteOpenHelper 类中的 getWritableDatabase() 和 getReadableDatabase() 方法可以获得数据库的引用。   为了实现对数据库版本进行管理, SQLiteOpenHelper 类提供了两个重要的方法,分别是 onCreate() 和 onUpgrade() ,前者用于初次使用软件时生成数据库表,后者用于升级软件时更新数据库表结构。   当调用SQLiteOpenHelper的 getWritableDatabase() 或者 getReadableDatabase() 方法获取用于操作数据库的SQLiteDatabase实例的时候,如果数据库不存在,Android系统会自动生成一个数据库,接着调用onCreate()方法。    onCreate() 方法在初次生成数据库时才会被调用,在onCreate()方法里可以生成数据库表结构及添加一些应用使用到的初始化数据。    onUpgrade() 方法在数据库的版本发生变化时会被调用,一般在软件升级时才需改变版本号,而数据库的版本是由程序员控制的。   假设数据库现在的版本是1,由于业务的变更,修改了数据库表结构,这时候就需要升级软件,升级软件时希望更新用户手机里的数据库表结构

Flutter - Can a ListView contain a static widget and a stream

心已入冬 提交于 2020-03-23 03:53:43
问题 Currently my I have a ListView that is warped by a StreamBuilder which gets data from firebase firestore (e.g a list of users). This is how it looks: Widget UsersList = new StreamBuilder( stream: Firestore.instance .collection('users') .snapshots(), builder: (context, snapshot) { if (!snapshot.hasData) return const Text("loading"); return new ListView.builder( itemCount: snapshot.data.documents.length, itemBuilder: (context, index) => _buildItem(context, snapshot.data.documents[index]), ); }

Flutter - Can a ListView contain a static widget and a stream

眉间皱痕 提交于 2020-03-23 03:53:11
问题 Currently my I have a ListView that is warped by a StreamBuilder which gets data from firebase firestore (e.g a list of users). This is how it looks: Widget UsersList = new StreamBuilder( stream: Firestore.instance .collection('users') .snapshots(), builder: (context, snapshot) { if (!snapshot.hasData) return const Text("loading"); return new ListView.builder( itemCount: snapshot.data.documents.length, itemBuilder: (context, index) => _buildItem(context, snapshot.data.documents[index]), ); }

ListView: MultiSelect items with mouse drag

心已入冬 提交于 2020-03-22 05:41:08
问题 In ListView, I can press Ctrl + Shift and click on the item to select. But, I want to drag the mouse to select the items (like DataGridView). I tried this code (below) and I had a problem like this: My code: Private mouseDownLV As Boolean Private Sub ListView1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown mouseDownLV = True End Sub Private Sub ListView1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ListView1

C# How to refresh a listview

无人久伴 提交于 2020-03-20 22:49:45
问题 I've writtent the following code : this.listView1.Items[i].BackColor = Color.Orange; I would like to know how can I refresh my listview so I can see in real time the updated listview. Thanks. 回答1: Normally you should not do anything special, and ListView will be redrawn itself when you're changing item's backcolor. But anyway, you can use listView1.Refresh(); to force its redrawing. 回答2: Try the following: listView1.Items.Clear(); 来源: https://stackoverflow.com/questions/30104779/c-sharp-how

安卓手机连接蓝牙打印机实现打印功能

穿精又带淫゛_ 提交于 2020-03-17 07:41:24
安卓手机连接蓝牙打印机实现打印功能 最近在做一个安卓应用,其中有一个需求是要求用蓝牙连接打印机实现打印功能。一开始没有一点头绪,网上找了很多资料也找不到有用的数据。所以自己就去研究,最终,功夫不负有心人,顺利的完成了这个功能。下边贴出我写的代码,共有需要的IT哥们参考学习。 完整源码下载 我们先看看运行效果图吧。。。 1.这是主界面的效果图 贴上布局文件的代码:bluetooth_layout.xml [html] view plain copy < span style= "font-size:12px" > <? xml version= "1.0" encoding= "utf-8" ?> < RelativeLayout android:layout_width= "match_parent" android:layout_height= "match_parent" > < Button android:id= "@+id/openBluetooth_tb" android:layout_width= "130dp" android:layout_height= "wrap_content" android:layout_alignParentRight= "true" android:layout_marginRight= "18dp" android:layout