• 二、Android Studio使用——导入jar包,运行、debug都不是问题


    【新建AndroidStudio工程,lib导入jar

      我们的项目代码都在app里面,可以看作是一个Model

      src 下面除了我们的代码之外,还有单元测试。

    把JAR复制到libs文件中。

     

    【Genymotion模拟器插件的安装、运行

    AndroidStudio安装Genymotion步骤:

    1) 从官方下载插件:https://www.genymotion.com/

    2AS中打开:

    http://www.loverobots.cn/the-method-of-association-genymotion-in-studio-android.html

     【rundebuy,打印变量

    第一个图标:打上断点,点直接调试,但这样运行太慢。

    第二个图标:一般开发中直接运行,然后在调试的地方打上断点后,点击

    【module的概念,添加library module

           

    把代码粘贴进来后,这个Module就新建好了。

    关联Module 步骤:在app右键打开,选择Open Module Settings

    现在就可以用了,在布局文件activity_main.xml中加入:

     1 <?xml version="1.0" encoding="utf-8"?>
     2 <com.firstdemo.stickyscroll.StickyScrollView
     3     xmlns:android="http://schemas.android.com/apk/res/android"
     4     android:layout_width="match_parent"
     5     android:layout_height="match_parent"
     6     android:overScrollMode="never"
     7     android:fadingEdge="none"
     8     android:fillViewport="true">
     9 
    10     <LinearLayout
    11         android:layout_width="match_parent"
    12         android:layout_height="wrap_content"
    13         android:orientation="vertical">
    14         <View
    15             android:layout_width="match_parent"
    16             android:layout_height="100dp"
    17             android:background="@color/font_red2"/>
    18         <View
    19             android:tag="sticky"
    20             android:layout_width="match_parent"
    21             android:layout_height="200dp"
    22             android:background="@color/home02"/>
    23         <View
    24             android:layout_width="match_parent"
    25             android:layout_height="300dp"
    26             android:background="@color/font_qingse"/>
    27         <View
    28             android:layout_width="match_parent"
    29             android:layout_height="300dp"
    30             android:background="@color/font_green2"/>
    31         <View
    32             android:layout_width="match_parent"
    33             android:layout_height="300dp"
    34             android:background="@color/home02"/>
    35 
    36     </LinearLayout>
    37 </com.firstdemo.stickyscroll.StickyScrollView>

    android:tag="sticky" 当控件设置该属性的时候,混动到这个布局,就会悬停。

     下一个知识点,我们如何管理Module 

    比如:我们不想要这个Module了,应该如何删除呢:

    app右键打开,选择Open Module Settings打开。

    这步,只是在配置中删除了。接着,

     最后一步,点击右键,然后删除,就OK了。

     DEMO下载地址:http://download.csdn.net/detail/androidsj/9490788

  • 相关阅读:
    常见算法的时间复杂度
    electron 展示pdf
    AudioContext
    js 计算文字宽度
    python 窗口被关闭报错
    qq行情数据。sina行情JOSN,建议用qq,涨跌,财务数据有-市盈
    python AttributeError: 'NoneType' object has no attribute 'prepare'
    策略日志
    使用Python下载A股行情的几种方法
    easytrader
  • 原文地址:https://www.cnblogs.com/androidsj/p/5390355.html
Copyright © 2020-2023  润新知