Today you want to draw a curve that changes dynamically based on the color of the parameter, and the parameters are not fixed, so you need to get the color values based on the parameters. Studied for a long time and engaged in a scheme that was implemented through paint.Paint contains a number of ways to set its properties, the main method is as follows:Setantialias: Sets the brush's jagged effect. setcolor: Setting Brush colorsSetargb: Sets the a,r,p
In the process of using textview, it is sometimes necessary to do a series of text in some of the text to do special display effect processing, such as bold, change color, highlighting, hyperlinks and so on, we can through a number of textview patchwork to achieve, but if the need for special processing of content in the middle of the entire text, It is too cumbersome and too low to cobble together multiple TextView, and the Android-provided Spannable
Color the content in double quotation marks:
Private void highlightsearchhint (spannable hintspan ){String hint = hintspan. tostring ();Log. I (TAG, "highlightsearchhint" + hint );Int Index =-1;Int start = 0;Boolean foundstartquote = false;
Do {Index = hint. indexof ("/" ", index + 1 );If (foundstartquote Index! =-1 ){Foundstartquote = false;Log. I (TAG, "highlight from" + (start + 1) + "to" + index );/* Each setspan must use a new foregroundcolorspan object */Foregroundcolorspan hintcolor = ne
By default, when edittext gets the focus, a soft keyboard will pop up. If you want to achieve this, a dialog box will pop up directly, like a time dialog box, instead of a soft keyboard, how can you disable the card to bring up a soft keyboard?
Method: setinputtype (inputtype. type_null) of the edittext instance is called in oncreate (). The Android: inputtype = "?? ",?? You can.
/** Init date edittext .*/View. ontouchlistener dateedittextontouchlist
TextView ttext= (TextView) Findviewbyid (r.id.textv_name); The 1th type: Ttext.settextcolor (Android.graphics.Color.RED);//system comes with the color class The 2nd type: Ttext.settextcolor (0XFFFF00FF);//0xffff00ff is the data of type int, group the 0x|ff|ff00ff,0x is the mark that represents the color integer, FF is the transparency, the FF00FF represents the color, Note: Here ffff00ff must be a color representation of 8, do not accept ff00ff color representation of this 6. The 3rd type:
(Activityinfo.screen_orientation_landscape);//Horizontal screenSet up the vertical screen code: setrequestedorientation (activityinfo.screen_orientation_portrait);//Vertical screenBecause the horizontal screen has two direction of the horizontal method, and this setting horizontal screen of the statement, assuming that it is not the default horizontal screen direction, will have a horizontal screen rotation of 180 °.So it is possible to infer whether it is a horizontal screen first. Assuming th
height) {
Final rect block = new rect (0, 0, offset, offset);
Canvas.drawrect (block, paint);
}
private static void Cliptopright (final canvas canvas, final paint paint, int offset, int Widt h, int height) {
Final rect block = new rect (Width-offset, 0, width, offset);
Canvas.drawrect (block, paint);
}
private static void Clipbottomleft (final canvas canvas, final paint paint, int offset, int wid th, int height) {
Final rect block = new rect (0, Height-of
Tag: Blank picture cannot get file element tar pre ROIReference to:http://blog.csdn.net/u012975705/article/details/49275001Before encountering a problem, that is, when using ScrollView, the layout of the ScrollView control can not fill the entire phone screen, by reading the source found, ScrollView has a Mfillviewport attribute:set to true, the scroll view measure its child to make it fill the currently visible areaThe idea is that when Mfillviewport is set
Today in the development process, the need to connect Hamidi TV box, this box is based on the android6.0 version, previously connected to other TV boxes are normal, when the input adb-s xxxx shell, the box connection failed, the log is as follows:Error:device Unauthorized.This ADB server ' s $ADB _vendor_keys are not setTry ' adb kill-server ' if that seems wrong.Otherwise Check for a confirmation dialog on your device.Log display, not authorized, the first reflection is not the developer option
Specific steps
1. Click "System Settings" in the Android phone and some of the phones are "set up" click to enter
2. In the mobile phone settings we will see the "WiFi Settings" option as shown below:
3. After entering WiFi settings, open the WLAN option, it will automatically search the surrounding WiFi signal,
4. General WiFi are required password, it does not matter, if you are in KFC, McDonald
Android phones unlock screen lock settings
Open settings, enter location and security
Select Set screen lock, then select pattern
Then draw the unlock pattern, repeat two times to draw, you can draw according to their own requirements, but I want to keep in mind OH
After the confirmation, it has been set up oh, back to the main interface, and then lock
Recently made a GridView on the set-top box,
The focus needs to be on the child control of item, but the GridView focus defaults on item, byAndroid:descendantfocusability= "Afterdescendants"
You can get the focus for the GridView child control. But after adding this attribute, the GridView becomes unable to scroll, and then I add a scrollview to the GridView,
But since all two have scroll bars, I rewrite a gridview to let the scroll
When you set layout parameters for the view in getview of the adapter, use the following method:
Layoutparams Params =NewLayoutparams (layoutparams. fill_parent ,(Int) (Metrics. heightpixels * 0.23f + 0.5f); Convertview. setlayoutparams (Params );
ProgramAn error occurs.
06-08 15:39:43. 071: E/androidruntime (610 ): Java. Lang. classcastexception: Android. View. viewgroup $ layoutparams 06-08 15:39:43.
After upgrading to 0.8.1, open the Set Font size page, you will find whether the default or Darcula, do not allow you to change the size of the font, in fact, this is because these two modes are Android Studio self-mode, so do not allow you to change, If you want to change, you need to customize your own pattern. Such as:Select the style you want, then click Save As and enter the name of your own defined st
outermost layout . Addonlayoutchangelistener (New Onlayoutchangelistener () {@Overridepublic void Onlayoutchange (View arg0, int arg1, int arg2, int arg3,int arg4, int arg5, int arg6, int arg7, int arg8) {TODO auto-generated Method Stubif (EditText. Hasfocus ()) {/*** There is no use of handler, so Sroderscrollview will not scroll to the bottom. Just scrolls the initialization height.* All scroll to the bottom if scrollview too long will cause edittext to roll out of the screen* New Handler ().
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.