• AQuery学习笔记(一)


    一、AQuery对象(两官方的两句话来介绍,英文很烂,写出大概我理解的意思)

      官方对AQuery对象的说明.

      There's only 1 main class in AQuery. That is, the AQuery class.

      AQuery object has two states: "root" and the "view".

      大概意思:只有一个主类,就是AQuery类,这个类有两种状态root和view;

       AQuery usage:

    1. Create an AQuery object with an activity, the root view of a fragment, a list item view (or any view container), or a context (for background ajax requests)
    2. Use the id() or find() methods to pick the current "view"
    3. Call the appropriate methods to update the view

         大概意思:AQuery对的root view(根视图),可以是一个Activity、fragment、Context或者是任意一个容器视图(如LinearLayout),

                       使用AQuery对象的id()或者find()方法调用一个View为当前操作的View,

            如:aquery.id(R.id.textView1).text("xxxxx");

            也可以是: aquery.id(R.id.textView1);

                                     aquery.text("xxxx");

                       上面两个示例结果一样,都是操作R.id.textView1的View.

    二、 AQuery简单的应用 

    AQuery aq = new AQuery(this);
    //加载id为tv1的TextView控件,并设置text属性值
    aq.id(R.id.tv1).text("fuck you!");
    //加载一个imageView控件,并设置背景图片
    aq.id(R.id.imageView1).image(
    R.id.logo);
    //加载一个View,为当前操作的View aq.id(R.id.imageView2);
    if(aq.isExist()){//判断这个是View是否存在,如果存在就返回true
      //aq.getImageView()是得到当前操作的View,并转换为ImageView.   ImageView iv
    = aq.getImageView();   iv.setBackgroundResource(R.drawable.logo2);
    }
  • 相关阅读:
    金蝶k3 显示BOS序时簿并返回选中的值
    金蝶K3bos插件操作另一张单据
    H2.64的远程回放--开篇
    监控外网访问的几种方式
    ilbc编解码
    windows系统上安装与使用Android NDK r5 (转)
    安卓与PC网络对接实现视频实时播放
    WDR7500 花生壳问题
    要确保任何一次员工的晋升都符合公司的利益
    关于“部门建设”
  • 原文地址:https://www.cnblogs.com/hbxblogs/p/2877861.html
Copyright © 2020-2023  润新知