
ANDROID ui
T-Quake
Android开发,HAL,driver, framework
展开
-
Android自定义radiobutton(文字靠左,选框靠右)
<RadioButton android:id="@+id/rb_never" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:color/trans原创 2012-09-10 13:52:50 · 11532 阅读 · 3 评论 -
开发日志整理2【android layout用法注意点】
记得在开发的时候,想要实现一个动画效果。就是某个控件能够在focus的时候,自身的高度能够向上增长。实现这个方法有好多种方法。比如采用动态改变控件的高度或者采用layout的方式。一开始啥也没想,就用了layout方法在属性动画中valueAnimator里面去变化先看下这个View.layout(int left, int top, int right, int bottom)它原创 2015-09-15 16:57:02 · 2311 阅读 · 0 评论 -
Android ViewPagr使用RequestFocus没有效果的解决方法
今天在开发的代码的时候,使用了Viewpage+fragment的结构,当切换到一个Fragment的时候,对一个RelativeLayout(Focusable=true, clickable=true已经设置过了)设置默认焦点,发现没有用。感觉很坑爹。 于是,自己写了一个测试程序,使用Activity发现可以的。想啊想啊,忽然想到,Framgent是预先加载的,所以原来requestFo原创 2014-02-13 17:30:02 · 4595 阅读 · 0 评论 -
Android 实现首次开机启动wizardsetup程序
Android 里面在pacakge/app/下面有个Provision程序,当Android第一次启动的时候它在Launcher启动前会被调用。所以如果我们想实现第一次开机自启动我们自己的引导设置程序我们可以在其代码中的DefaultActivity.java里面加入如下:Intent intent = new Intent();ComponentName componentName原创 2014-01-11 10:25:00 · 9536 阅读 · 0 评论 -
android edittext password hint字体不同于别的字体的解决
EditText password = (EditText) findViewById(R.id.register_password_text);password.setTypeface(Typeface.DEFAULT);password.setTransformationMethod(new PasswordTransformationMethod());此外需要去除xml中的androi转载 2013-04-16 16:37:47 · 6224 阅读 · 1 评论 -
cannot be cast to android.widget.HeaderViewListAdapter
cannot be cast to android.widget.HeaderViewListAdapter用listview设置header或footerview,通常发生该异常。如果你没有发生,那是碰巧。但是你可能不知道原因。如果在listview.setAdapter(adapter)方法之后 添加头或尾view,即addHeaderView或 addFooterView,转载 2013-01-24 17:29:13 · 11808 阅读 · 0 评论 -
android listview 刷新背景变黑色
android:cacheColorHin=“”转载 2013-01-08 12:56:53 · 1745 阅读 · 0 评论 -
android listview 和button 共存的事件响应问题。
如果listview 的item里面有button,imagebutton,往往会造成click事件被button截取,而listview的item收不到click事件,通过google,发现需要做两件事情1 在item的布局中给我们最大的layout设置1个属性 android:descendantFocusability="blocksDescendants" blocksD转载 2013-01-08 10:31:35 · 1886 阅读 · 0 评论 -
android ui 布局<线性布局中的剩余空间使用>
一个线性布局中 有两个控件,A和B:如果想让B控件大小固定,A的宽度使用B剩下的空间。那么可以这样实现:A控件中使用android:layout_weight="1", B控件不要设置这个,只需要把你的固定长度大小写出来就行了。原创 2012-09-21 16:19:32 · 5096 阅读 · 0 评论 -
Android UI设计 ViewPager 中嵌套HorizontalScrollView
在开发的过程中,viewpager有的时候需要嵌套HorizontalScrollView,但是会遇到一种情况就是HorizontalScrollView的滑动事件被viewpager截取了,导致HorizontalScrollView无法工作。看了下网上的文章在stackoverflow看到了一个解决方案。需要是重写这个HorizontalScrollView:public class原创 2012-09-19 11:23:33 · 8012 阅读 · 5 评论 -
Android 自定义Viewpager滑动速度
由于Viewpager的滑动速度是固定的,所以很蛋疼。看了老外的文章可以利用反射机制,修改Viewpager的滑动速度。下面是代码实现: 需要新建个类FixedSpeedScoller继承自scroller类import android.content.Context;import android.view.animation.Interpolator;import andro原创 2014-01-11 10:29:29 · 12583 阅读 · 8 评论