1.button的属性textAllCaps=false,可是控制输入的小写字母不变成大写。
2.progressBar默认是圆形的,在xml文件中加入以下属性可以变成长条形的
style="?android:attr/progressBarStyleHorizontal"3.谷歌已经不推荐使用progressDialog,因为使用精度条的交互更加优秀。
4.android的基本布局:LinearLayout线性布局,RelativeLayout相对布局,FrameLayout帧布局,百分比布局。
讲一下百分比布局,它需要导入android support库
compile 'com.android.support:percent:26.0.0-alpha1'
它包含
android.support.percent.PercentFrameLayout和
android.support.percent.PercentRelativeLayout宽高的设置不会自定提示,因为它不在基础support中
app:layout_widthPercent="50%" app:layout_heightPercent="50%"5.当很多页面需要用一个相同的布局,我们可以将这些布局写在一个布局文件中,然后在每个页面引入它就可以用了,有效避免了大量的重复代码
public TitleLayout(final Context context, @Nullable AttributeSet attrs) { super(context, attrs); LayoutInflater.from(context).inflate(R.layout.title,this); Button left=(Button) findViewById(R.id.left); left.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { ((Activity)context).finish(); } }); Button right=findViewById(R.id.right); right.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Toast.makeText(context,"click the edit",Toast.LENGTH_LONG).show(); } }); }然后在其他布局界面就能够引用了
7.listview和recyclerView的内容竟然丢失了!!!!!!!!!!!!!!!!不想重写。等以后再来回顾吧
如对本文有疑问, 点击进行留言回复!!
Codeforces C. A Cookie for You (模拟 / 分类 / 贪心) (Round #654 Div.2)
DialogFragment弹窗(带黑色透明背景和不带黑色透明背景)
网友评论