二、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

转载于:https://www.cnblogs.com/androidsj/p/5390355.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值