巧用TextView实现分隔线
来源:互联网 发布:mysql for mac 下载 编辑:程序博客网 时间:2024/05/01 05:56
在写这个项目的时候,需要用到分隔线,思索无果,后来想到TextView恍然大悟,一点小技巧。在在
先上效果图:
布局代码:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="fill_parent" android:layout_height="wrap_content" tools:context="com.example.theold.MainActivity" tools:ignore="MergeRootFrame" > <LinearLayout android:id="@+id/linearlayoutmain" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <DigitalClock android:layout_weight="1" android:id="@+id/clock" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="70sp" android:layout_gravity="center_horizontal" android:background="@drawable/time_bg" android:textColor="#000000"/> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="30sp" android:fontFamily="宋体" android:background="#ADFF2F" android:id="@+id/dateandweather"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageButton android:layout_weight="1" android:src="@drawable/img_call" android:id="@+id/enterPhoneCall" android:background="@drawable/selector" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:background="#000000" android:layout_width="4dp" android:layout_height="fill_parent"/> <ImageButton android:layout_weight="1" android:src="@drawable/img_message" android:id="@+id/enterMessage" android:background="@drawable/selector" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> <TextView android:background="#000000" android:layout_width="fill_parent" android:layout_height="4dp"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageButton android:layout_weight="1" android:id="@+id/enterFlashlight" android:src="@drawable/img_flashlight" android:background="@drawable/selector" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <TextView android:background="#000000" android:layout_width="4dp" android:layout_height="fill_parent"/> <ImageButton android:layout_weight="1" android:id="@+id/enterMusic" android:background="@drawable/selector" android:src="@drawable/img_music" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> <TextView android:background="#000000" android:layout_width="fill_parent" android:layout_height="4dp"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageButton android:layout_weight="1" android:id="@+id/enterCamera" android:src="@drawable/img_camera" android:background="@drawable/selector" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <TextView android:layout_width="4dp" android:background="#000000" android:layout_height="fill_parent"/> <ImageButton android:layout_weight="1" android:id="@+id/enterPhotos" android:src="@drawable/img_photo" android:background="@drawable/selector" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> <TextView android:background="#000000" android:layout_width="fill_parent" android:layout_height="4dp"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageButton android:layout_weight="1" android:id="@+id/enterSOS" android:background="@drawable/selector" android:src="@drawable/img_sos" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <TextView android:layout_width="4dp" android:background="#000000" android:layout_height="fill_parent"/> <ImageButton android:layout_weight="1" android:src="@drawable/img_compass" android:id="@+id/enterCompass" android:background="@drawable/selector" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> <TextView android:background="#000000" android:layout_width="fill_parent" android:layout_height="4dp"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageButton android:id="@+id/enterAboutMore" android:layout_width="fill_parent" android:background="#2E8B57" android:src="@drawable/img_aboutmore" android:layout_height="wrap_content"/> </LinearLayout> </LinearLayout></ScrollView>
1 0
- 巧用TextView实现分隔线
- css实现分隔线
- GridView分隔线的实现
- RecylerView通用分隔线实现
- Android GridView分隔线实现
- CSS HTML 实现虚线横线分隔线
- CSS多种方法实现分隔线
- recyclerView 分隔线 最简实现法
- RecycleView实现瀑布流添加分隔线
- Textview 里面文字加单词分隔符
- Android textview实现删除线
- Android textview实现删除线
- 分隔线
- SDK实现分隔条
- SDK实现分隔条
- 字符串分隔(java实现)
- c++实现字符串分隔
- python实现-字符串分隔
- Android Studio 添加动态库os文件的方法
- POJ -- 3615 Cow Hurdles
- 基于ssh2的购物网--后台
- 1004. Counting Leaves (30)
- C++的杂七杂八:如何实现一个简单的bind
- 巧用TextView实现分隔线
- 【c#】 5. Tensor数据(用于Excel中不同sheet中都有矩阵的情况)
- POJ -- 3660 Cow Contest
- 【noi1998】【免费馅饼】
- 寒假14项目1——动态数组体验(修改4)
- 数学学不会 代码跟着跪
- POJ -- 3159 Candies
- POJ 1251 Jungle Roads (MST)
- hdu 3047 Zjnu Stadium 带权并查集