zoukankan      html  css  js  c++  java
  • 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);
    }
  • 相关阅读:
    服务器传输方式
    vs2010中设置环境变量方法
    乱语研发人员的安全感
    乱语研发人员的激情
    乱语员工发展之自由流动
    闲言碎语话心得什么时候轮到我
    一个企业没落,不是聪明人太多了,而是傻人太少了
    闲言碎语话心得凭什么是他(她)
    胡言乱语之客服人员
    选择指定表的字段名
  • 原文地址:https://www.cnblogs.com/hbxblogs/p/2877861.html
Copyright © 2011-2022 走看看