view

Android tablelayout view does not appear

橙三吉。 提交于 2020-11-29 04:08:16
问题 New to android programming. I have a layout XML, to which I want to add a list (with items from a database), formatted as a table. Here's the code: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.edit_cat); DatabaseHandler db = new DatabaseHandler(this); List<Category> allCategories = db.getAllCategories(); //Get the main layout from XML LinearLayout mainLayout = (LinearLayout) findViewById(R.id.edit_cat); //Create table layout for

Android tablelayout view does not appear

杀马特。学长 韩版系。学妹 提交于 2020-11-29 04:08:00
问题 New to android programming. I have a layout XML, to which I want to add a list (with items from a database), formatted as a table. Here's the code: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.edit_cat); DatabaseHandler db = new DatabaseHandler(this); List<Category> allCategories = db.getAllCategories(); //Get the main layout from XML LinearLayout mainLayout = (LinearLayout) findViewById(R.id.edit_cat); //Create table layout for

sails的简单配置以及controller的使用

对着背影说爱祢 提交于 2020-11-28 04:20:25
因为前段时间的一个项目,用到了sails,那么上回已经介绍过了sails的安装和如何创建项目, 没看过的童鞋可以使劲戳这里 http://my.oschina.net/codingBingo/blog 既然已经可以创建项目了,那么接下来就是项目的配置以及使用啦, 因为sails是基于nodejs的开发的服务端工具,所以用它来开发一些数据计算比较少的项目是相当的快的,而且nodejs天生的异步回调机制可以很好地避免高并发的问题,难怪阿里的人这么喜欢它, 咳咳,不扯了,下面主要介绍 一下sails的controller层是如何使用使用的. 首先我们先在根目录下的views文件夹中新建一个user.ejs文件,这是view层用的 <div> <%=userName%> </div> 然后在config文件中找到route.js文件,打开编辑, '/':{[ views:'homePage' }, 'get /userName':{ controller:user, action:sendUserName } 接下来新建controller文件,在api目录下找到controller文件夹,创建文件UserController.js文件 modules.exports={ sendName:function(req,res){ res.views('pages/user',{