QQ空间 新浪微博 腾讯微博 微信 更多
  

七月十四日安卓学习笔记

七月十四日安卓学习笔记

https://www.bilibili.com/video/av47341108/?p=2

1 Activity必须要知道的那些事

安装常用的插件:

genymotion:打开模拟器

adb 常用的adb快速命令

markdown: 快速预览markdown

TextView:

android :id/layout_width="match_parent"

android :layout_height="match_parent"

android : gravity="center、" //放置的 位置

android:textColor=”“

android:singLines=“”

android:maxLine

点击事件:

//所有的view都可以点击

左下角可以选择Design直接拖动制作UI

onLongClick(View v)

addTextChangedListener()

Toast.makeText(“超过多少字”)

让图片自适应不变形:只有上下重复的地方可以拉伸;

ImageButton 继承ImageView继承于view
android: layout_width=
android:layout_height=
android:background=
android:src= ”“

android:scaleType=”centerCrop,fitCenter,“

//进度条

<ProgressBar

其余相关的控件

5 开发布局详解

五种布局:

LinearLayout 线性,从上到下

1.  android:orientation=“vehicle、herision”
2.  android:weightSum=
3.  

RelativeLayout 相对布局:

  1. android:layout_below

  2. android:layout_alignLeft="id/button"

    1. android:layout_margin="100dp"	//边距
    
  3. android:paddingLeft= ”“ //内边距

FrameLayout帧布局

xmlns:android=“” //安卓的命名空间

AbsoluteLayout

TableLayout

6 布局优化技巧

基本控件+五大布局

  1. 官方建议布局不超过十层
  2. 利用相对布局减少层次
  3. 控件组合

一些属性

重要的布局文件

减少视图层级

需要时才加载

不要用多个Layout_weight属性

HierarchyViewer,工具用来优化布局;

7 ListView

微信使用ListView;

posted @ 2019-07-14 17:04  nupt想象之中  阅读(189)  评论(0编辑  收藏  举报