Android Study Notes (2)-android font style settings

Source: Internet
Author: User

1. Set the shadow font of Android

    <TextView  android:id="@+id/tvText1"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="text1"        android:textSize="30sp"        android:textStyle="bold"        android:textColor="#FFFFFF"        android:shadowColor="#ff0000ff"       android:shadowDx="5"       android:shadowDy="5"            android:shadowRadius="10"/>  

Android: shadowcolor shadow color

Android: horizontal offset of shadowdx shadow

Android: vertical offset of shadowdy shadow

Android: shadowradius shadow range

To unify the style and reuse the code, we can usually extract the style into the style. xml file.

    <?xml version="1.0" encoding="utf-8"?>      <resources>          <style name="textstyle">                     <item name="android:shadowColor">#ff0000ff</item>              <item name="android:shadowRadius">10</item>              <item name="android:shadowDx">5</item>              <item name="android:shadowDy">5</item>               </style>      </resources>  

<Textview style = "@ style/textstyle" Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: text = "Font Style" Android: textsize = "30sp" Android: textstyle = "bold"/>

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.