Implement rounded border and Android rounded border in the android Layout

Source: Internet
Author: User

Implement rounded border and Android rounded border in the android Layout

Project Structure

Parse Image

Each red square represents a linklayout

Each red circle represents an imageview

Each green circle represents a textview

Their relationships are as follows:


Bg_boder.xml

<? Xml version = "1.0" encoding = "UTF-8"?> <Shape xmlns: android = "http://schemas.android.com/apk/res/android"> <! -- Background color. Here I am white --> <solid android: color = "# FFFFFF"/> <! -- Rounded corner processing --> <corners android: topLeftRadius = "10dp" android: topRightRadius = "10dp" android: bottomRightRadius = "10dp" android: bottomLeftRadius = "10dp"/> </shape>
Add main. xml to the laout folder

<? Xml version = "1.0" encoding = "UTF-8"?> <LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" android: layout_width = "match_parent" android: layout_height = "match_parent" android: background = "# E1E0DE" android: orientation = "vertical"> <TextView android: id = "@ + id/textView1" android: layout_width = "match_parent" android: layout_height = "50dp" android: background = "#2B3439" android: gravity = "center" android: text = "found" android: textColor = "# FFFFFF" android: textSize = "20sp"/> <LinearLayout android: id = "@ + id/test_login_div" android: layout_width = "fill_parent" android: layout_height = "50dp" android: layout_margin = "10dp" android: background = "@ drawable/bg_boder" android: gravity = "center_vertical" android: padding = "10dp"> <ImageView android: id = "@ + id/test_imageView1" android: layout_width = "25sp" android: layout_height = "25sp" android: src = "@ drawable/friend"/> <TextView android: id = "@ + id/test_textView2" android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: layout_marginLeft = "14dp" android: text = "" android: textColor = "#000" android: textSize = "18sp"/> </LinearLayout> <LinearLayout android: layout_width = "fill_parent" android: layout_height = "101dp" android: layout_margin = "10dp" android: background = "@ drawable/bg_boder" android: orientation = "vertical" android: padding = "10dp"> <LinearLayout android: layout_width = "wrap_content" android: layout_height = "50dp"> <ImageView android: layout_width = "25sp" android: layout_height = "25sp" android: src = "@ drawable/OK"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: layout_marginLeft = "14dp" android: text = "scan" android: textColor = "#000" android: textSize = "18sp"/> </LinearLayout> <LinearLayout android: layout_width = "wrap_content" android: layout_height = "50dp" android: layout_centerVertical = "true"> <ImageView android: layout_width = "25sp" android: layout_height = "25sp" android: src = "@ drawable/rock"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: layout_marginLeft = "14dp" android: text = "Shake" android: textColor = "#000" android: textSize = "18sp"/> </LinearLayout> <LinearLayout android: layout_width = "fill_parent" android: layout_height = "101dp" android: layout_margin = "10dp" android: background = "@ drawable/bg_boder" android: orientation = "vertical" android: padding = "10dp"> <LinearLayout android: layout_width = "wrap_content" android: layout_height = "50dp"> <ImageView android: layout_width = "25sp" android: layout_height = "25sp" android: src = "@ drawable/people"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: layout_marginLeft = "14dp" android: text = "nearby" android: textColor = "#000" android: textSize = "18sp"/> </LinearLayout> <LinearLayout android: layout_width = "wrap_content" android: layout_height = "50dp" android: layout_centerVertical = "true"> <ImageView android: layout_width = "25sp" android: layout_height = "25sp" android: src = "@ drawable/bottle"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: layout_marginLeft = "14dp" android: text = "float bottle" android: textColor = "#000" android: textSize = "18sp"/> </LinearLayout> <LinearLayout android: id = "@ + id/login_div" android: layout_width = "fill_parent" android: layout_height = "50dp" android: layout_margin = "10dp" android: background = "@ drawable/bg_boder" android: gravity = "center_vertical" android: padding = "10dp"> <ImageView android: id = "@ + id/imageView1" android: layout_width = "25sp" android: layout_height = "25sp" android: src = "@ drawable/game_center"/> <TextView android: id = "@ + id/textView2" android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: layout_marginLeft = "14dp" android: text = "Game Center" android: textColor = "#000" android: textSize = "18sp"/> </LinearLayout>
Final

Change the Android Studio Screen


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.