Xiao bin want to do anything Ningchong cause far attention 2016.06.30 10:16* words 489 read 3234 comments 3 likes ObjectiveBecause the damned undead design is wet, a set of white status bar UI is designed. Of course, on iOS can be adaptive, but Android is more troublesome, so has not been engaged. Recently saw an article on the White bottom black word! Android Light status bar Black
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.
Style = "@ style/textstyle"
Android uses LinearGradient for font gradientLinearGradient is also called linear rendering. LinearGradient implements linear gradient of colors in a region. It has two constructors: public LinearGradient (float x0, float y0, float x1, float y1, int color0, int color1, Shader. tileMode tile) Where x0 indicates the starting point x coordinate of the gradient, y0 indicates the starting point y coordinate of t
Objective: A design manual in Android designs. There are commonly used UI icons, icon size specifications, and so on in the design manual.Among them, there is a TTF font, previously felt useless. But when I was studying, I often saw a lot of developers using GoogleThe TTF font provided. I counted it. There are 19 fonts to choose from, while
The typeface class is used in the android SDK to define the font. You can set the font type by using the common font type name, such as setting the default:
Paint mp = new paint();
mp.setTypeface(Typeface.DEFAULT_BOLD)
CommonFont type nameAlso:
Typeface. Default // Regular font
In Android, our applications can flexibly embed their own font files to enable normal display of personalized text on various mobile phones. We all know that the settypeface method of textview can set the display characteristics of the target text, such as font, color, bold, and italic. We can directly find a truetypefont fon
There are usually two types of font settings:1: Set directly in XMLAndroid:textstyle= "Bold" android:typeface2: Set in the form of Java codeUse the typeface class in the Android SDK to define fonts, which can be set by common font type names, such as setting Italic:TextView Quehuo = (TextView) Findviewbyid (R.id.quehuo);//Set style TextView for the fonts display
Facebook Open source has a load effect tool shimmer, can achieve the glittering effect of the font, the effect of such as the following
The link address is https://github.com/facebook/Shimmer here, just for iOS development. Looked under did not understand (have not made object-c, embarrassed ZR), so conveniently searched shimmer Android, actually someone did, here https://github.com/RomainPiel/ Shimmer
When adding text in TextView, sometimes you need to change some text font color, today learned three ways to share 1. Set the font color directly in the configuration XML file under the layout file by adding android:textcolor= "#FFFFFF" To change the colorBut this effect only allows the font to display a color2. In activity through TextView tv=new TextView (this)
//spannablestring object set to TextView mytextview.settext (SP); 62//Set TextView can click Mytextview.setmovementmethod (linkmovementmethod.getinstance ()); 64}65} When using Spannablestring objects, be aware thatThe role of spanned.span_exclusive_exclusive, etc.:Used to identify whether or not to use this effect when entering new characters before and after text in a span range. Spanned.span_exclusive_exclusive (not included), Spanned.span_inclusive_exclusive (previously included, not incl
Android does not support layout XML to directly use TTF and other custom fonts.
The Custom font must be placed in the asset directory and context must be called. the getassets () method is used to obtain the resources of custom fonts. Because Android widgets depend on other processes, fonts cannot be used in widgets. the settypeface method. Therefore, you can use
The font size can be set within the Android system parameter setting:The font size ratio can be obtained by using the following code:functionFontscale:single;varresources:jresources; configuration:jconfiguration;beginResult:=1; ifTandroidhelper.context Nil Then beginResources:=TAndroidHelper.Context.getResources; ifResources Nil Then beginConfigura
Android offers three different fonts: "
Sans”,“
Serifand
monospace”。
1. Set fonts in the Android XML fileYou can use Android:typeface, such as android:typeface= "monospace". In this example we are in the activity of android:text= "Hello, world! Hello "Four different display methods, in order," Sans "," serif "," monospace "and the system default mode (the test by default using Sans). There are differences
Ubuntu in the Chinese font to look at the total sense of a bit uncomfortable, so Baidu, here is recorded how to install Windows fonts in Ubuntu 12.04Step1. Go to the Windows system to copy a fontGenerally speaking, the Windows system fonts are in c/windows/fonts, so go straight in and pick the font you like.For convenience, I directly copied all the fonts in the Fonts folder and placed them in the ~/winfont
learned that this pop-up thing called preview, we can modify its layout.Add the android:keypreviewlayout tag to our custom Keyboardview and add the following:Then in the Layout folder, create a new Key_preview_layout.xml file, which writes?
12
1.0 encoding=utf-8?-->"#ff8888ff/" android:gravity="center" android:layout_height="wrap_content" android:layout_width="wrap_content" android:textcolor="@android:color/white" android:textsize="40sp" xmlns:android="http://schemas.android.co
Ssb.setspan (new Relativesizespan (1.2f), 1, Ssb.length (), spannable.span_exclusive_exclusive); return SSB;}Effects such as:watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvtlvqvgjvevpiqg==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center "/>Project Source: Https://github.com/nuptboyzhb/ViewPageAnimatorDemoNot for commercial purposes without consentOf course, you can also consider using the open source code: Https://github.com/as
1. Get the screen size of the current device
Displaymetrics displaymetrics = new Displaymetrics ();
This.getwindowmanager (). Getdefaultdisplay (). Getmetrics (Displaymetrics);
2. Calculate the aspect ratio of the screen size set at the time of your development (this assumes that the screen size you set for development is 480*)
int screenwidth = Displaymetrics.widthpixels;
int screenheight = Displaymetrics.heightpixels;
float ratiowidth = (float) screenwidth/ 480;
float
In Android, the font color changes after a button is clicked. androidbutton
The button clicking effect is undoubtedly very simple, I was so lazy that when the UI told me that the color of the button font would change with the background when I clicked, I did not hesitate to tell him to cut two pictures, later I thought it was not very reliable, so I learned how t
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.