01 2022 档案

摘要:首先是创建WebViewActivity.java文件: 1 public class WebViewActivity extends AppCompatActivity { 2 private WebView WVmain; 3 @Override 4 protected void onCreat 阅读全文
posted @ 2022-01-30 22:48 KongLong_cm 阅读(235) 评论(0) 推荐(0) 编辑
摘要:在原来的基础上将LinearAdapter.java进行修改: 1 public class LinearAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{ 2 private Context mcontext; 3 priv 阅读全文
posted @ 2022-01-30 20:11 KongLong_cm 阅读(139) 评论(0) 推荐(0) 编辑
摘要:首先建立一个 PbRecyclerViewActivity.java文件: 1 public class PbRecyclerViewActivity extends AppCompatActivity { 2 private RecyclerView RVpb; 3 @Override 4 pro 阅读全文
posted @ 2022-01-30 18:42 KongLong_cm 阅读(691) 评论(0) 推荐(0) 编辑
摘要:建立RecyclerViewActivity.java文件 1 public class RecyclerViewActivity extends AppCompatActivity { 2 private Button BtnLinear; 3 private Button BtnShuiping 阅读全文
posted @ 2022-01-30 15:13 KongLong_cm 阅读(274) 评论(0) 推荐(0) 编辑
摘要:RecyclerView能够灵活实现大数据集的展示,视图的复用管理比ListView更好,能够显示列表、网格、瀑布流等形式,且不同的ViewHolder能够实现item多元化的功能。但是使用起来会稍微麻烦—点,并且没有类似ListView的onItemClickListener监听事件,需要开发者自 阅读全文
posted @ 2022-01-30 10:14 KongLong_cm 阅读(145) 评论(0) 推荐(0) 编辑
摘要:当我们在写一个页面,内容过多时我们需要滚动页面来查看,但是注意ScrollView下只能有一个元素,所以要把主页面改下,这样就只有一个LinearLayout元素: 1 <ScrollView xmlns:android="http://schemas.android.com/apk/res/and 阅读全文
posted @ 2022-01-28 23:35 KongLong_cm 阅读(115) 评论(0) 推荐(0) 编辑
摘要:首先建立gridViewActivity的Java文件 1 public class GridViewActivity extends AppCompatActivity { 2 private GridView GV; 3 @Override 4 protected void onCreate(@ 阅读全文
posted @ 2022-01-28 23:12 KongLong_cm 阅读(76) 评论(0) 推荐(0) 编辑
摘要:依然是一个listView的Java文件 1 public class ListViewActivity extends Activity { 2 private ListView lv1; 3 @Override 4 protected void onCreate(@Nullable Bundle 阅读全文
posted @ 2022-01-28 15:43 KongLong_cm 阅读(33) 评论(0) 推荐(0) 编辑
摘要:第七章——在项目开始之前 不要搜集需求,挖掘它们。需求是对需要完成的某件事情的陈述。 “搜集”一词似乎在暗示,一群快乐的分析师,随着背景音乐播放的温柔的《田园交响曲》,寻觅散布在四周地面上的智慧金块。“搜索”暗示着需求已经在那里——你只需找到它们,把它们放进你的篮子,就可以愉快地上路了。 (写这句话 阅读全文
posted @ 2022-01-18 12:34 KongLong_cm 阅读(27) 评论(0) 推荐(0) 编辑
摘要:第四章——注重实效的偏执 你不可能写出完美的软件。把它视为生活的公理,接受它,拥抱它,庆祝它。因为完美的软件不存在。 按合约设计(简称DBC),使用它的最大好处是它迫使需求与保证的问题走到前台来。 尽早检测问题的好处之一是你可以更早崩溃。而许多时候,让你的程序崩溃是你的最佳选择。要崩溃,不要破坏。( 阅读全文
posted @ 2022-01-16 17:47 KongLong_cm 阅读(25) 评论(0) 推荐(0) 编辑
摘要:第一章——注重实效的哲学 作为一个负责人的程序员,在遇到问题时,应该是提供各种选择,不要找蹩脚的借口。 在写代码的过程中,破窗效应同样适用,所以在出现小问题的时候就应该及时解决,不要容忍破窗户。我们看到过整洁、运行良好的系统,一旦窗户开始破裂,就相当迅速的恶化。置之不理会更快的加速腐烂的进程。 石头 阅读全文
posted @ 2022-01-16 14:31 KongLong_cm 阅读(47) 评论(0) 推荐(0) 编辑
摘要:1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_pare 阅读全文
posted @ 2022-01-12 16:32 KongLong_cm 阅读(482) 评论(0) 推荐(0) 编辑
摘要:1 public class CheckBoxActivity extends AppCompatActivity { 2 private CheckBox cb_5,cb_6; 3 @Override 4 protected void onCreate(Bundle savedInstanceSt 阅读全文
posted @ 2022-01-12 14:02 KongLong_cm 阅读(131) 评论(0) 推荐(0) 编辑
摘要:1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_pare 阅读全文
posted @ 2022-01-12 14:01 KongLong_cm 阅读(141) 评论(0) 推荐(0) 编辑
摘要:1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_pare 阅读全文
posted @ 2022-01-12 12:23 KongLong_cm 阅读(73) 评论(0) 推荐(0) 编辑
摘要:1 private RadioGroup mrg1; 2 @Override 3 protected void onCreate(Bundle savedInstanceState) { 4 super.onCreate(savedInstanceState); 5 setContentView(R 阅读全文
posted @ 2022-01-12 12:21 KongLong_cm 阅读(111) 评论(0) 推荐(0) 编辑
摘要:1 package com.example.first; 2 3 import androidx.appcompat.app.AppCompatActivity; 4 5 import android.content.Intent; 6 import android.os.Bundle; 7 imp 阅读全文
posted @ 2022-01-12 12:19 KongLong_cm 阅读(93) 评论(0) 推荐(0) 编辑
摘要:登录页面的账号和密码需要用edittext写 1 <EditText 2 android:id="@+id/et_1" 3 android:layout_width="match_parent" 4 android:layout_height="50dp" 5 android:textSize="2 阅读全文
posted @ 2022-01-07 22:43 KongLong_cm 阅读(349) 评论(0) 推荐(0) 编辑
摘要:按钮点击出现提示框,需在xml对应的Java文件中定义方法,例如: 1 public class ButtonActivity3 extends AppCompatActivity { 2 3 @Override 4 protected void onCreate(Bundle savedInsta 阅读全文
posted @ 2022-01-07 12:24 KongLong_cm 阅读(561) 评论(0) 推荐(0) 编辑
摘要:需要在drawable下建立xml文件,内容如下: 1 <selector xmlns:android="http://schemas.android.com/apk/res/android"> 2 <!--设置在按压时的效果--> 3 <item 4 android:state_pressed=" 阅读全文
posted @ 2022-01-07 12:01 KongLong_cm 阅读(184) 评论(0) 推荐(0) 编辑
摘要:设置按钮的样式在drawable下建立xml文件,例如: 1 <shape xmlns:android="http://schemas.android.com/apk/res/android" 2 android:shape="rectangle"><!--形状为长方形--> 3 <!--填充颜色- 阅读全文
posted @ 2022-01-07 11:38 KongLong_cm 阅读(75) 评论(0) 推荐(0) 编辑
摘要:在页面中的代码: 1 <Button 2 android:id="@+id/btn_2" 3 android:layout_width="match_parent" 4 android:layout_height="50dp" 5 android:text="按钮2号" 6 android:text 阅读全文
posted @ 2022-01-07 11:10 KongLong_cm 阅读(515) 评论(0) 推荐(0) 编辑
摘要:按钮点击跳转页面:(在java文件里写) 1 public class MainActivity extends AppCompatActivity { 2 3 private Button mbtnTextView; 4 5 @Override 6 protected void onCreate( 阅读全文
posted @ 2022-01-06 22:42 KongLong_cm 阅读(77) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示