您的位置:首页 > 其它

实习第五天——老大不在,自学成才。今日的十八个收获

2012-06-30 05:46 260 查看
为了详细地记录一天中的各种小收获,我开始实时记笔记了。不过由于是在Ubuntu下的外文系统,所以不得不用英文了。

The communication from Android device to localhost running on local machine. 这个问题至今还没彻底解决,就是说在真机测试的时候要如何让手机访问本地电脑上架设的web服务器。请大家指教。
Want to add a loading page when login. Create un dialog in a new Thread : Exception, can't create handler inside Thread that has not called looper.prepare();这是对Android进程机制不够熟悉造成的问题。只要细心阅读相关资料定能解决。
Annule 2, continue the next.为了赶进度,没有查资料……
To use logcat with more than one devices。我同时在真机和模拟器里测试程序,但是logcat似乎无法兼顾。解决办法是到ddms界面中,选择当前使用的机器,再回到logcat就可以了。
关于Android布局属性中weight的透彻解析:About Weight:The weight value allows you to specify the amount of remaining space each view should consume,relative to the amount consumed by sibling views, just like the ingredients in a drink recipe: "2parts vodka, 1 part coffee
liquer" means two-thirds of the drink is vodka. For example, if you giveone view a weight of 2 and another one a weight of 1, the sum is 3, so the first view gets 2/3 ofthe remaining space and the second view gets the rest. If you give a third view a weight
of 1,then the first view now gets 1/2 the remaining space, while the remaining two each get 1/4. 基本意思就是同一级别下的各个view的weight值代表了他们父控件给他们分配多余空间时的比重。
official site is powerful。Android开发者网站最近改版了。教程非常丰富。另外提醒大家,开发时下载的sample code也是不错的学习工具。
Adapter。各种Adapter是把view和view的数据绑定在一起的一个桥梁。
styles and themes.设计Android时也是可以考虑风格和主题的。 http://developer.android.com/guide/topics/ui/themes.html
<include>_titlebar。 安卓xml也可以使用include以便对组件进行重用。如titlebar。 http://developer.android.com/design/style/metrics-grids.html 这个网址讲述了关于android设备的尺寸的问题。你的控件应该设置成多大? http://developer.android.com/reference/android/view/View.html 设计界面之前最好能知道Android到底提供了哪些view。他们都是View类的子类。查看他的子类和间接子类就可以一览无余了。
QuickContactBadge. 这个主题还没有详细查看。
framelayout 不太好说,不过不难。可以自己查查看

use alignLeft... to overlay other view。如果想做出覆盖效果,可以把上层的view四边与底层view对齐。


use canvas。暂未详细查阅
view switcher。把两个view叠在一起,可以进行切换。同一时间,只能显示一个。
如何在java代码中动态增加控件?我所涉及到的布局是GridView。需要做的是实现一个 BaseAdapter的子类,然后实现 getView方法。之后用GridView的setAdapter方法把两者联系起来。

最后是一点体会——先把东西做出来,然后再一点点完善。这比想一下子就做完美要轻松一点。
ok,又一天过去了,明天是实习以来的第一个周末,好好休息!

程序猿和攻城狮都是人类的好朋友,注意身体啊!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: