Set the color and font of the control.
Code:
Package com. oyzz. a7_6;
Import Android. App. activity;/* The graphics. Color must be referenced to use the color. * object */Import Android. Graphics. color;Import Android. Graphics. typeface;
Import Android. OS. Bundle;Import Android. View. view;
/* Widget. Button must be referenced to declare the use of the button object */Import Android. widget. Button;
/* You must reference widget. textview to declare
Code:
Package com. oyzz. a7_6;
Import Android. App. activity;/* The graphics. Color must be referenced to use the color. * object */Import Android. Graphics. color;Import Android. Graphics. typeface;
Import Android. OS. Bundle;Import Android. View. view;
/* Widget. Button must be referenced to declare the use of the button object */Import Android. widget. Button;
/* You must reference widget. textview to declare the use of the testview objec
brush color.
Setargb (int A, int r, int g, int b)
void
Sets the brush's a (transparency), R (red), G (green), B (blue), Value (0X00000000-0XFFFFFFFF). The single value range is 0-255.
Settypeface (Typeface Typeface)
Typeface
Set the font, through the typeface can load
not provide the Font class below the j2's, instead of Typeface, which provides readers with more options, because Typeface can be customized, however, in order to seamlessly port the j2's program to the Android platform, the author encapsulates a Font class similar to that under the j2's platform, as shown below:
Import android. graphics. Typeface;
Public clas
Difference:
\ R:
full name: Carriage return (carriage is" The word car "means, A part on the printer)
abbreviation: R
ASCII code:
action: Move the cursor to the leftmost
on the current line
\ n:
Full Name: New line
Alias: Line Feed
Abbreviation: n
ASCII code: 10
Action: Move the cursor down one line
how different operating systems represent "carriage return + newline" (that is, the end of
1. The origin of carriage return and line feed
First, clarify two concepts:
Press ENTER Cr-move the cursor to the beginning of the current row.Wrap lf-move the cursor vertical to the next line. (Instead of moving to the beginning of the next line, that is, do not change the horizontal position of the cursor)
Before the computer appeared, there was a kind of thing called teletype model 33, which also came from the TTY concept in Linux/Unix. It can contain 10 characters per second. But ther
set in effect.Dt_wordbreak: Interrupts the word. Lines are automatically interrupted between words if the word expands beyond the bounding rectangle specified by the lprect parameter. When not specified, the output is in one row.Dt_word_ellipsis: Truncate word does not fit rectangle, add ellipsis.Successful, returns the text height. Logical units.When Dt_vcenter or Dt_bottom is specified, the return value is the offset lprect->top to the bottom of the drawing text.Failed, 0The text alignment mo
Android switches the third-party font for the entire application
I,
1. Obtain and replace the system font through reflection
import java.lang.reflect.Field;import android.content.Context;import android.graphics.Typeface;public final class FontsOverride { public static void setDefaultFont(Context context, String staticTypefaceFieldName, String fontAssetName) { final Typeface regular = Typeface.createFromAsset(context.getAssets(),
ArticleDirectory
Intro free font
Stiff staff font
Archive
Governor an Art Deco alphabet
Rbno2
Kilogram
Infinity
Hagin font
Prime font
FV Almelo
Rex free font
Forum font
Code pro
Color lines free font
Kankin font
Habana font
Cube 02 font
Cube font
Bender font
Muncie font
Croissant-free Google Web font
Null free font
Cassannet font
Facunda font
Multicolore Fonts
Plstk font
Chrome light font
Myra font
Metropolis
The TextView font support is limited in the Android operating system. By default, the typeface attribute of TextView supports three fonts: "Sans", "serif", and "monospace, if no font is specified, the system uses "Sans" as the text display font by default. However, these three fonts only support English. That is to say, as long as you display Chinese characters, the display effect is the same no matter which one of the three fonts you choose. To this
Android switches the third-party font for the entire application, and android third-party font
I,
1. Obtain and replace the system font through reflection
import java.lang.reflect.Field;import android.content.Context;import android.graphics.Typeface;public final class FontsOverride { public static void setDefaultFont(Context context, String staticTypefaceFieldName, String fontAssetName) { final Typeface regular = Typeface.createF
document) with VIM or gedit under Linux (or a new. C document, which can be browsed in Windows with VC6.0!). )。 To open it, you can also enter the command directly: (Note that if the file name is Chinese, it may not be found, you need LS, then copy the file name, and then gedit paste the file name) Gedit Xx.doc or Vim Xx.doc (not recommended, VIM may not support traditional Chinese characters) or directly find the file, click, Open Office, select Character Set (System), character (SYSong18030),
Cr: carriage return: return the front of the typewriter. Corresponding \ RLF: line feed, typewriter rolling down a line. corresponding to the \ n typewriter era, these are instructions for directing typewriter mechanical work, the computer era is only displayed on the screen. Cr + LF is a standard line break for text f
Why does the carriage return record come from:
Before the appearance of PC, secretaries used typewriter to print documents. (Brother is the most famous product version ).
The typewriter is printed with a lead character, and its keyboard is arranged in the same way as the current PC keyboard.
(In view of people's habits, the keyboard layout of typewriter keyboard
Enter key, that is, the entry on the keyboard, is a more useful key, in the text editing, enter the role of the return line, in the input URL when the key role is "go", in the implementation of the DOS command, the role of the Enter is to perform ... On the standard keyboard, there are 2 return keys, one on the right side of the main keyboard area, the top of the SHIFT key (pictured below), one on the lower-right corner of the keypad, and below the plus key.
History of the Enter key
About the
2012-10-20 Noip Demo Game
by COOLYANGZC
A total of 3 questions, time 3 hours
Topic name
Advanced Typewriter
Unequal series
Management and development
source file
Type.cpp/c/pas
Num.cpp/c/pas
Exploit.cpp/c/pas
Input file
Type.in
Num.in
Exploit.in
Output file
Type.out
Num.out
Exploit.out
Time limit
1000MS
1000MS
1000MS
Memor
Android native fonts may not let the UI sister paper favor, it is too ugly, so the UI sister paper used third-party fonts as the font style of the app, this blog is to summarize in the development of Android app how to use third-party fonts.first, there must be a third-party font library , where the font library file is black_simplified. TTF, create a new front folder under the Android Assert directory and place the font library file under the front directory, which is/assert/front/black_simplif
1. Set the font in the Android XML file
AvailableAndroid: Typeface, for example, android: typeface = "monospace ". In this example, android: text = "Hello, World! Hello, there are four display modes: "Sans", "serif", "monospace", and "sans" by default ). There are differences in English fonts. It seems that there are no differences in Chinese fonts. The XML file is as follows:
Java code:
An
1.Custom fontYou can use the setTypeface (Typeface) method to set the text font in the text box, while the android Typeface uses the TTF font file to set the font.Therefore, we can put the TTF font file in the program and use Typeface in the program to set the font: Step 1: Create a fonts directory under the assets Directory and put the TTF font file here. Step 2
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.