New UI-shadow TextView and ui-textview

Source: Internet
Author: User

New UI-shadow TextView and ui-textview

New UI-shadow TextView

-- Reprinted please indicate the source: coder-pig. You are welcome to repost it. Please do not use it for commercial purposes!


The piggy Android development and exchange group has been established. You are welcome to join us. You can be a newbie, cainiao, or a great god.

After all, the power is limited. There will certainly be a lot of flaws in writing. You are welcome to point out, brainstorm, And let pig's blog post.

For more details, help more people, O (∩ _ ∩) O thank you!

Piggy Android Development Exchange Group:Piggy Android Development GroupGroup Number:421858269

New Android UI instance catalog:Http://blog.csdn.net/coder_pig/article/details/42145907



This section introduces:

This section describes how to set a shadow effect for TextView text ~

In addition, the shadow effect is not displayed on the ADT. You need to run it to see it!



Body of this section:

The core is the following attributes:

Android: textColor: set text color

Android: shadowColor: Set the shadowColor, which must be used with shadowRadius!

Android: shadowRadius: sets the Blur degree of the Shadow. If it is set to 0.1, the font color is changed. We recommend that you use 3.0.

Android: shadowDx: sets the offset of the shadow in the horizontal direction, which is the abscissa position starting from the shadow in the horizontal direction.

Android: shadowDy: sets the offset of the shadow in the vertical direction, which is the ordinate position starting from the shadow in the vertical direction.



Code Demonstration:

<RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" android: layout_width = "match_parent" android: layout_height = "match_parent" tools: context = "com. jay. example. test. mainActivity "> <TextView android: layout_width =" wrap_content "android: layout_height =" wrap_content "android: layout_centerInParent =" true "android: shadowColor =" # F9F900 "android: shadowDx = "10.0" android: shadowDy = "10.0" android: shadowRadius = "3.0" android: text = "shadow TextView" android: textColor = "# 4A4AFF" android: textSize = "30sp"/> </RelativeLayout>


Run:




Okay. You can set the shadow effect for TextView here ~




Related Article

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.