最近一直在想自己的职业规划,可能程序员不适合女生做,但是我却很喜欢现在的工作。也梦想着哪天成为一个designer.....
所以为了成为一个优秀的程序员,我开始写博客。
这段时间学了很多东西,但是都没有好好总结,我知道一个不知道总结的程序员是不会成为一个优秀的程序员的。
今天先总结一点吧,以后慢慢补充。如下图:
实现的是返回按钮位于上层,我最初的想法是利用framelayout,将按钮图片放在上层,后来发现实现很艰难,后来看到同事的代码,发现使用relativelayout还不错。代码如下:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="@null" >
<LinearLayout
android:id="@+id/llCooperationRoot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="@drawable/banner_cooporation" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shadow_banner_bottom" />
</LinearLayout>
</ScrollView>
<include layout="@layout/layout_btn_back"/>
</RelativeLayout>
其中返回按钮图片包含在layout_btn_back.xml文件中,代码如下:
<?xml version="1.0" encoding="utf-8"?>
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ib_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_return"
android:background="@null"
android:layout_margin="10dp"
android:layout_alignParentBottom="true"/>