- 博客(4)
- 收藏
- 关注
转载 几种控件的使用代码
(1)TextView android:id="@+id/name_text_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:textSize="sp" android:textColor="#beea"
2017-06-17 14:13:00
459
转载 shape的使用并完成按钮机制
(1)匿名内部类 public class TestButtonActivity extends Activity { Button btn1, btn2; Toast tst; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedIns
2017-06-17 14:11:10
350
转载 关于dp、px、sp以及线性布局、相对布局
(1)px (pixels)(像素):屏幕上的点 ,与密度相关。密度大了,单位面积上的px会比较多。 (2)dip或dp(与密度无关的像素)。这个和设备硬件有关,为了支持WVGA、HVGA和QVGA 5进制空间推荐使用这个。一种基于屏幕密度的抽象单位。设置一些view的宽高可以用这个,一般情况下,在不同分辨率,都不会有缩放的感觉。如果用px的话,320px占满HVGA的宽度,到WVGA上就只能
2017-06-17 14:07:53
377
转载 安卓基本代码
Button button = new Button(this); EditText editText = new EditText(this); editText.setWidth(200); editText.setTransformationMethod(PasswordTransformationMethod.getInstance()); TextView textView =
2017-03-27 18:57:54
367
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人