个人笔记(第四篇)

来源:互联网 发布:宿州影楼美工招聘兼职 编辑:程序博客网 时间:2024/05/18 07:17

今天主要是遇到了三个问题。

第一个:屏幕适配,这个真的需要好好学了,虽然做出来了,但是效果简直就是强形拼上去的样子,多多注意;

第二个:沉浸布局,网上找了很多方法,然后也解决了,但是总感觉解决的方式有点投机取巧,网址这里了

http://blog.csdn.net/qq_38500074/article/details/72783041

第三个:把Activity变成悬浮框,并设置其大小,以及空白处点击事件:

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:id="@+id/activity_person_track_view"    android:gravity="center_vertical|center_horizontal"    tools:context="com.example.administrator.qinghuayuan.person.PersonTrackActivity"    >    <RelativeLayout        android:layout_width="@dimen/DIMEN_360PX"        android:layout_height="@dimen/DIMEN_600PX"        android:gravity="center">
 </RelativeLayout></RelativeLayout>

然后在对应的Activity添加对整个View的点击监听。由于是限制了大小和位置的,所以会留出空白,空白的地方就是点击的地方了

 relativeLayout=(RelativeLayout)findViewById(R.id.activity_person_track_view);        relativeLayout.setOnTouchListener(new View.OnTouchListener() {            @Override            public            boolean onTouch(View v, MotionEvent event) {                finish();                return false;            }        });

暂时就到这里吧.哦,对了,祝大家端午节快乐啊,好好休息,放松一下去吧