面试宝典
面试必问知识点、BATJ历年历年面试真题+解析
学习经验总结
(一)调整好心态
心态是一个人能否成功的关键,如果不调整好自己的心态,是很难静下心来学习的,尤其是现在这么浮躁的社会,大部分的程序员的现状就是三点一线,感觉很累,一些大龄的程序员更多的会感到焦虑,而且随着年龄的增长,这种焦虑感会越来越强烈,那么唯一的解决办法就是调整好自己的心态,要做到自信、年轻、勤奋。这样的调整,一方面对自己学习有帮助,另一方面让自己应对面试更从容,更顺利。
(二)时间挤一挤,制定好计划
一旦下定决心要提升自己,那么再忙的情况下也要每天挤一挤时间,切记不可“两天打渔三天晒网”。另外,制定好学习计划也是很有必要的,有逻辑有条理的复习,先查漏补缺,然后再系统复习,这样才能够做到事半功倍,效果才会立竿见影。
(三)不断学习技术知识,更新自己的知识储备
对于一名程序员来说,技术知识方面是非常重要的,可以说是重中之重。**要面试大厂,自己的知识储备一定要非常丰富,若缺胳膊少腿,别说在实际工作当中,光是面试这一关就过不了。**对于技术方面,首先基础知识一定要扎实,包括自己方向的语言基础、计算机基础、算法以及编程等等。
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:background=“@color/color_ff0000”
android:layout_marginTop=“@dimen/dimen_10”
android:padding=“10dp”
android:text=“背景色红色的文本”
android:textColor=“@color/white” />
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginTop=“@dimen/dimen_10”
android:background=“@drawable/bg_tv_frame_red”
android:padding=“10dp”
android:text=“带着红色边框的文本” />
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginTop=“@dimen/dimen_10”
android:background=“@drawable/bg_tv_frame_gradient”
android:padding=“10dp”
android:textColor=“@color/white”
android:text=“带着边框和背景色渐变的文本” />
background设置边框的文件 android:background=“@drawable/bg_tv_frame_red”
<?xml version="1.0" encoding="utf-8"?>带着边框和背景色渐变 android:background=“@drawable/bg_tv_frame_gradient”
<?xml version="1.0" encoding="utf-8"?><gradient
android:startColor=“@color/color_188FFF”
android:centerColor=“@color/color_FF773D”
android:endColor=“@color/color_ff0000”
android:type=“linear”
/>
2.在xml中创建,在代码中设置属性
- 布局文件
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
android:layout_margin=“@dimen/dimen_20”
android:orientation=“vertical”>
<TextView
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:text=“下面是用代码实现效果”
android:textSize=“@dimen/text_size_18”
android:layout_marginTop=“@dimen/dimen_20”
android:layout_marginBottom=“@dimen/dimen_10”
android:textColor=“@color/black”
android:textStyle=“bold” />
<TextView
android:id=“@+id/tv_flag”
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:textColor=“@color/color_188FFF”
android:layout_marginTop=“@dimen/dimen_10”
android:text=“给文本加划线”
android:textSize=“@dimen/text_size_18” />
<TextView
android:id=“@+id/tv_gradient”
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_marginTop=“@dimen/dimen_10”
android:textColor=“@color/white”
android:text=“文字渐变是不是很神奇”
android:textSize=“@dimen/text_size_18” />
<TextView
android:id=“@+id/tv_bg”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginTop=“@dimen/dimen_10”
android:padding=“10dp”
android:text=“设置背景色”
android:textColor=“@color/white”
android:textSize=“@dimen/text_size_18” />
<TextView
android:id=“@+id/tv_size”
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_marginTop=“@dimen/dimen_10”
android:textColor=“@color/color_ff0000”
android:text=“文字特别大小不一致” />
<TextView
android:id=“@+id/tv_onclick”
android:layout_width=“match_parent”
android:layout_marginTop=“@dimen/dimen_10”
android:layout_height=“wrap_content”
android:textSize=“@dimen/dimen_20”
android:text=“可点击可长按” />
- 运行结果
- 在代码中实现
//下划线并加清晰
tv_flag.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
tv_flag.getPaint().setAntiAlias(true);//抗锯齿
int[] colors = {0xff188fff, 0xffff773D, 0xffff0000};//颜色的数组
LinearGradient mLinearGradient = new LinearGradient(0, 0, 0,
tv_gradient.getPaint().getTextSize(), colors, null, Shader.TileMode.CLAMP);
tv_gradient.getPaint().setShader(mLinearGradient);
tv_gradient.invalidate();
int fillColor = Color.parseColor(“#ff0000”);//内部填充颜色
GradientDrawable gd = new GradientDrawable();//创建drawable
gd.setColor(fillColor);//设置背景色
gd.setCornerRadius(10);//设置圆角
tv_bg.setBackground(gd);//设置背景
Spannable wordtoSpan = new SpannableString(tv_size.getText().toString());
//setSpan:参数1,设置文字大小;参数2,开始的文字位置;参数3,结束改变文字位置不包含这个位置
wordtoSpan.setSpan(new AbsoluteSizeSpan(DensityUtil.dip2px(this, 18)), 0, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
wordtoSpan.setSpan(new AbsoluteSizeSpan(DensityUtil.dip2px(this, 24)), 2, 5, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
wordtoSpan.setSpan(new AbsoluteSizeSpan(DensityUtil.dip2px(this, 10)), 5, tv_size.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
tv_size.setText(wordtoSpan);
//TextView其实也是有点击事件的毕竟它的爸爸Veiew
tv_onclick.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MLog.e(“这里是点击事件”);
Toast.makeText(TextViewActivity.this,“这里是点击事件”,Toast.LENGTH_SHORT).show();
}
});
tv_onclick.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
MLog.e(“这里长按事件”);
Toast.makeText(TextViewActivity.this,“这里长按事件”,Toast.LENGTH_SHORT).show();
//true表示事件已消费
return true;
}
});
总结
作为一名从事Android的开发者,很多人最近都在和我吐槽Android是不是快要凉了?而在我看来这正是市场成熟的表现,所有的市场都是温水煮青蛙,永远会淘汰掉不愿意学习改变,安于现状的那批人,希望所有的人能在大浪淘沙中留下来,因为对于市场的逐渐成熟,平凡并不是我们唯一的答案!
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
场都是温水煮青蛙,永远会淘汰掉不愿意学习改变,安于现状的那批人,希望所有的人能在大浪淘沙中留下来,因为对于市场的逐渐成熟,平凡并不是我们唯一的答案!
[外链图片转存中…(img-HYUPCghy-1715591385455)]
[外链图片转存中…(img-gXJhpSP1-1715591385456)]
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!