2010-10-21 68 views
2

你好 我想为可点击天数的android创建月视图日历。我应该使用什么样的布局/视图,TableLayout或GridView。我没有找到任何的例子此...GridView与TableLayout | Android

感谢您的帮助提前

回答

2

我想说GridView,特别是如果你打算把所有的日历数据在ContentProvider与其他应用程序共享。然后,您可以使用您的供应商和适配器,以填补在GridView动态

+0

感谢您的帮助,我会看看 – 2010-10-22 06:41:56

+0

@schwiz我在我的项目中使用了GridView,但我不想在GridView中滚动。好心建议我做什么。 – 2012-03-13 11:30:49

2

检查GridView中休耕教程:

http://www.firstdroid.com/2011/02/06/android-tutorial-gridview-with-icon-and-text/

了解本教程后,就在的末尾添加休耕线onCreate方法:

grid_main.setOnItemClickListener(new OnItemClickListener() { 
    public void onItemClick(AdapterView<?> parent, View view, int position, 
          long id) { 

     // Add your code here, you receive the index, 
     // you can start an intent or do whatever you wanted 
     // to do with the button 

    }/* End of onItemClick */ 
}); 

BR,

阿德里安。