Here is my test code, the final results LinearLayout gray border, how to retain the frame at the bottom or top of the frame to remove the other three directions?
boder.xml
& Lt;? Xml version = "1.0" encoding = "utf-8" & gt;?
& Lt; shape xmlns: android = "http://schemas.android.com/apk/res/android" & gt;
& Lt; stroke
android: width = "0.01dp"
android: color = "# C6C7CE" / & gt;
& Lt; padding
android: bottom = "5dp"
android: top = "5dp"
android: left = "5dp"
android: right = "5dp" / & gt;
& Lt; / shape & gt;
text.xml
& Lt;? Xml version = "1.0" encoding = "utf-8" & gt;?
& Lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
android: orientation = "vertical"
android: layout_width = "fill_parent"
android: layout_height = "fill_parent" & gt;
& Lt; LinearLayout android: layout_width = "fill_parent" android: layout_height = "wrap_content"
android: orientation = "vertical" android: gravity = "center"
android: background = "@ drawable / boder" & gt;
& Lt; TextView android: layout_width = "fill_parent" android: layout_height = "wrap_content"
android: text = "@ string / log_name" / & gt;
& Lt; / LinearLayout & gt;
& Lt; / LinearLayout & gt;
Reply:
& Lt; padding
android: bottom = "5dp"
android: top = "5dp"
android: left = "5dp"
android: right = "5dp" / & gt;
Not around to 0 on the line
Reply:
Can be attached renderings, it will analyze with better points
Reply:
This is just within the set margins
Reply:

Reply:
Solve ah?
Reply:
& Lt; TextView
android: background = "@ color / mainColor"
android: layout_width = "match_parent"
android: layout_height = "1dp" / & gt;
Reply:
You can add elements such as a view
below& Lt; View
android: layout_width = "fill_parent"
android: layout_height = "1dip"
android: background = "@ color / iht_grey" / & gt;
Reply:
Gifts of roses shop unless,
Although I solved this problem, or shared it to newcomers. . .
XML layout:
& Lt;? Xml version = "1.0" encoding = "UTF-8" & gt;?
& Lt; layer-list xmlns: android = "http://schemas.android.com/apk/res/android" & gt;
& Lt; -! Even frame color values - & gt;
& Lt; item & gt;
& Lt; shape & gt;
& Lt; solid android: color = "# 000000" / & gt;
& Lt; / shape & gt;
& Lt; / item & gt;
& Lt; -! The main background color value - & gt;
& Lt; item
android: top = "1dp"
android: left = "1dp"
android: right = "1dp" & gt;
& Lt; shape & gt;
& Lt; solid android: color = "# ffffff" / & gt;
& Lt; / shape & gt;
& Lt; / item & gt;
& Lt; / layer-list & gt;
Reply:
This is not just only set the border to solve the problem in a certain direction, you can specific? Thanks!
Reply:
Landlord I solved a big problem
Reply:
In this way you just subtract the two color blocks it
Reply:
The best way is to add a imageview
Reply:
Are not really clear,
**********************************************
Leaving latecomers, setting only the bottom border of the method, in drawable in New xml, select the layer-list, the following code, the code slightly modified:
& Lt;? Xml version = "1.0" encoding = "UTF-8" & gt;?
& Lt; layer-list xmlns: android = "http://schemas.android.com/apk/res/android" & gt;
& Lt; -! Even frame color values - & gt;
& Lt; item & gt;
& Lt; shape & gt;
& Lt; solid android: color = "# 000000" / & gt;
& Lt; / shape & gt;
& Lt; / item & gt;
& Lt; -! The main background color value - & gt;
& Lt; item android: bottom = "1dp" & gt; & lt; - set only the bottom border - & gt;
!& Lt; shape & gt;
& Lt; solid android: color = "# ffffff" / & gt;
& Lt; / shape & gt;
& Lt; / item & gt;
& Lt; / layer-list & gt;
Reply:
13th Floor positive solution, thank you very much
No comments:
Post a Comment