
50 Android hacks
文章平均质量分 69
sadsadsadsadsazcAS
这个作者很懒,什么都没留下…
展开
-
Combining weightSum and layout_weight
想要实现的是按钮占据屏幕的一半,无论是横屏还是竖屏: 源码: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="m原创 2015-01-16 08:25:08 · 509 阅读 · 0 评论 -
Using lazy loading and avoiding replication(延迟加载和避免重复)
1.Avoid replication using the tag <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:l原创 2015-01-16 09:18:06 · 644 阅读 · 0 评论 -
使用Preferences
如图,当新建Activity的时候: 他的布局在xml文件夹下。原创 2015-01-17 09:55:17 · 550 阅读 · 0 评论 -
Creating a custom ViewGroup(自定义ViewGroup)
想要实现下面的UI效果: When you’re designing your application, you might have complex views that will show up in different activities. Imagine that you’re creating a card game and you want to show the user’s原创 2015-01-17 09:24:41 · 765 阅读 · 0 评论 -
使用LayoutAnimationController
结合《第一行代码》的ListView的例子,在ListView的setAdapter方法之前,添加下面的代码: AnimationSet set = new AnimationSet(true); Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(300); animation原创 2015-01-19 09:34:15 · 659 阅读 · 0 评论 -
TextSwitcher的使用
TextSwitcher 字面理解是文字交换器,是ViewSwitcher的子类,从ViewSwitcher来看,是View交换器,TextSwitcher继承自ViewSwitcher,显然是交换TextView。 应用分为三步: 1.得到 TextSwitcher 实例对象 TextSwitcher switcher = (TextSwitcher) findViewById(R原创 2015-01-19 09:08:40 · 667 阅读 · 0 评论