zoukankan      html  css  js  c++  java
  • 个人设置页面布局 小例子

    效果图:

    layout布局:

    <?xml version="1.0" encoding="utf-8"?>
    
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
                    android:layout_height="match_parent" android:background="@drawable/personcenter_home_bg">
    
        <FrameLayout
            android:layout_marginTop="56dp" android:layout_marginLeft="@dimen/set_margin"
            android:layout_width="@dimen/set_login_size"
            android:layout_height="@dimen/set_login_size" android:id="@+id/flyt_head">
    
            <TextView
                android:layout_width="match_parent" android:layout_height="match_parent"
                android:background="@drawable/personcenter_head_bg" android:id="@+id/txt_head_logout"
                android:gravity="center_horizontal" android:paddingTop="20dp" android:textSize="@dimen/textsize_40px"
                android:textColor="@color/white" android:text="@string/login"
                android:drawableTop="@drawable/personcenter_head_src" android:drawablePadding="10dp"/>
    
            <ImageView
                android:visibility="gone" android:id="@+id/img_head_login" android:layout_width="match_parent"
                android:layout_height="match_parent" android:src="@drawable/icon"/>
        </FrameLayout>
    
        <TextView
            android:layout_centerHorizontal="true" android:layout_marginTop="15dp"
            android:id="@+id/txt_person_name"
            android:layout_below="@id/flyt_head"
            android:visibility="gone"
            android:gravity="center_horizontal"
            android:layout_alignLeft="@id/flyt_head"
            android:textSize="@dimen/textsize_26px" android:textColor="@color/white"
            android:layout_width="@dimen/set_login_size" android:layout_height="wrap_content"/>
    
        <RelativeLayout
            android:id="@+id/rlyt_notice" android:layout_below="@id/flyt_head" android:layout_marginTop="10dp"
            android:layout_alignLeft="@id/flyt_head" android:background="@drawable/personcenter_home_notice_bg"
            android:layout_width="wrap_content" android:layout_height="wrap_content">
    
            <TextView
                android:layout_centerHorizontal="true" android:layout_marginTop="15dp"
                android:textSize="@dimen/textsize_20px" android:textColor="@color/white" android:text="@string/notice"
                android:layout_width="wrap_content" android:layout_height="wrap_content"/>
    
        </RelativeLayout>
    
        <TextView
            android:layout_alignTop="@id/flyt_head" android:layout_alignParentRight="true"
            android:layout_marginRight="@dimen/set_margin"
            style="@style/SetButton"
            android:background="@drawable/personcenter_mycourses_btn_bg" android:id="@+id/txt_mycourses"
            android:text="@string/my_courses"
            android:drawableTop="@drawable/personcenter_mycourses_btn_src"/>
    
        <FrameLayout
    
            android:layout_below="@id/txt_mycourses"
            android:layout_alignParentRight="true" android:layout_marginRight="@dimen/set_margin"
            android:layout_marginTop="13dp"
            android:id="@+id/flyt_registryorlogout"
            android:layout_width="@dimen/set_button_size" android:layout_height="@dimen/set_button_size">
    
            <TextView
                style="@style/SetButton"
                android:background="@drawable/personcenter_registry_btn_bg" android:id="@+id/txt_registry"
                android:text="@string/registry"
                android:drawableTop="@drawable/personcenter_registry_btn_src"/>
    
            <TextView
                android:visibility="gone" style="@style/SetButton"
                android:background="@drawable/personcenter_registry_btn_bg" android:id="@+id/txt_logout"
                android:text="@string/logout"
                android:drawableTop="@drawable/personcenter_logout_btn_src"/>
        </FrameLayout>
    
        <TextView
            android:layout_below="@id/flyt_registryorlogout" android:layout_alignParentRight="true"
            android:background="@drawable/personcenter_mycollections_btn_bg"
            android:id="@+id/txt_mycollections"
            android:text="@string/my_collection"
            android:visibility="invisible"
            android:drawableTop="@drawable/personcenter_mycollections_btn_src"
    
            android:layout_marginRight="@dimen/set_margin" android:layout_marginTop="13dp" style="@style/SetButton"
            />
    
    
        <TextView
            android:layout_toLeftOf="@id/flyt_registryorlogout"
            style="@style/SetButton"
            android:background="@drawable/personcenter_settings_btn_bg" android:layout_marginRight="13dp"
            android:id="@+id/txt_settings" android:layout_alignTop="@id/txt_mycollections"
            android:text="@string/settings"
            android:drawableTop="@drawable/personcenter_settings_btn_src"/>
    
        <TextView
            android:layout_toLeftOf="@id/txt_settings" style="@style/SetButton"
            android:background="@drawable/personcenter_feedback_btn_bg" android:layout_marginRight="13dp"
            android:layout_alignTop="@id/txt_mycollections"
            android:id="@+id/txt_feedback"
            android:text="@string/feedback" android:drawableTop="@drawable/personcenter_feedback_btn_src"
            />
    </RelativeLayout>
    <style name="SetButton">
            <item name="android:layout_height">@dimen/set_button_size</item>
            <item name="android:layout_width">@dimen/set_button_size</item>
            <item name="android:gravity">center_horizontal</item>
            <item name="android:paddingTop">15dp</item>
            <item name="android:textSize">@dimen/textsize_34px</item>
            <item name="android:textColor">@color/white</item>
            <item name="android:drawablePadding">7dp</item>
        </style>
  • 相关阅读:
    三种编程命名规则(匈牙利法,小驼峰法,大驼峰法)
    javaSE_Java第一周总结:有难度题目集合
    javaSE_06Java中的数组(array)-练习
    javaSE_06Java中的数组(array)-思维导图
    javaSE_06Java中的数组(array)
    Python10_代码规范和可读性
    URL&URI
    Python9_类
    Python8_关于编码解码和utf-8
    Python7_内置函数总结
  • 原文地址:https://www.cnblogs.com/niuxx-android/p/5499120.html
Copyright © 2011-2022 走看看