freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

android系統(tǒng)外文翻譯3-android-全文預(yù)覽

  

【正文】 rs. Typically, they are used to identify adjacent widgets (., a “Name:” label before a field where one fills in a name). In Java, you can create a label by creating a TextView instance. More monly, though, you will create labels in XML layout files by adding a TextView element to the layout, with an android:text property to set the value of the label itself. If you need to swap labels based on certain criteria, such as internationalization, you may wish to use a resource reference in the XML instead, as will be described in Chapter 9. TextView has numerous other properties of relevance for labels, such as: ? android:typeface to set the typeface to use for the label (., monospace) ? android:textStyle to indicate that the typeface should be made bold (bold), italic (italic),or bold and italic (bold_italic) ? android:textColor to set the color of the label’s text, in RGB hex format (., FF0000 for red) For example, in the Basic/Label project, you will find the following layout file: ?xml version= encoding=utf8? TextView xmlns:android= android:layout_width=fill_parent android:layout_height=wrap_content android:text=You were expecting something profound? / As you can see in Figure 61, just that layout alone, with the stub Java source provided by Android’s project builder (., activityCreator), gives you the application. 第 25 頁(yè) 共 35 頁(yè) Figure 61. The LabelDemo sample application Button, Button, Who’s Got the Button? We’ve already seen the use of the Button widget in Chapters 4 and 5. As it turns out, Button is a subclass of TextView, so everything discussed in the preceding section in terms of formatting the face of the button still holds. Fleeting Images Android has two widgets to help you embed images in your activities: ImageView and ImageButton. As the names suggest, they are imagebased analogues to TextView and Button, respectively. Each widget takes an android:src attribute (in an XML layout) to specify what picture to use. These usually reference a drawable resour ce, described in greater detail in the chapter on resources. You can also set the image content based on a Uri from a content provider via setImageURI(). 第 26 頁(yè) 共 35 頁(yè) ImageButton, a subclass of ImageView, mixes in the standard Button behaviors, for responding to clicks and whatnot. For example, take a peek at the layout from the Basic/ImageView sample project which is found along with all other code samples at ?xml version= encoding=utf8? ImageView xmlns:android= android:id=+id/icon android:layout_width=fill_parent android:layout_height=fill_parent android:adjustViewBounds=true android:src=drawable/molecule / The result, just using the codegenerated activity, is shown in Figure 62. Figure 62. The ImageViewDemo sample application 第 27 頁(yè) 共 35 頁(yè) Fields of Green. Or Other Colors. Along with buttons and labels, fields are the third “anchor” of most GUI toolkits. In Android, they are implemented via the EditText widget, which is a subclass of the TextView used for labels. Along with the standard TextView properties (., android:textStyle), EditText has many others that will be useful for you in constructing fields, including: ? android:autoText, to control if the field should provide automatic spelling assistance ? android:capitalize, to control if the field should automatically capitalize the first letter of entered text (., first name, city) ? android:digits, to configure the field to accept only certain digits ? android:singleLine, to control if the field is for singleline input or multipleline input (., does Enter move you to the next widget or add a newline?) Beyond those, you can configure fields to use specialized input methods, such as android:numeric for numericonly input, android:password for shrouded password input, and android:phoneNumber for entering in phone numbers. If you want to create your own input method scheme (., postal codes, Social Security numbers), you need to create your own implementation of the InputMethod interface, then configure the field to use it via android: inputMethod. For example, from the Basic/Field project, here is an XML layout file showing an EditText: ?xml version= encoding=utf8? EditText xmlns:android= android:id=+id/field android:layout_width=fill_parent android:layout_height=fill_parent 第 28 頁(yè) 共 35 頁(yè) android:singleLine=false / Note that android:singleLine is false, so users will be able to enter in several lines of text. For this project, the file populates the input field with some prose: package 。(this)。 public class NowRedux extends Activity implements { Button btn。 import 。 你可能會(huì)如前所述用禁用插件來(lái)使用,以確保一旦您禁用操作完成,正確的部件具有焦點(diǎn)。 所有部件,包括以前的那些示例,擴(kuò)展視圖,這樣使所有部件一系列有用的性能,并超越那些已經(jīng)介紹的方法。 大多數(shù)時(shí)候,你會(huì)想要在 RadioGroup里面放進(jìn)一個(gè) RadioButton的小部件。 第 13 頁(yè) 共 35 頁(yè) 圖 64 CheckBoxDemo示例應(yīng)用程序,未選中的復(fù)選框 第 14 頁(yè) 共 35 頁(yè) 圖 65 同樣的應(yīng)用,選中的復(fù)選框 打開收音機(jī) 由于與其他單選按鈕在其他工具包執(zhí)行時(shí), Android的單選按鈕是兩種狀態(tài),如復(fù)選框,但可分為這樣,只有一組中的單選按鈕可以隨時(shí)選中。 } } } 請(qǐng)注意為復(fù)選框的狀態(tài)變化 activity作為其自身監(jiān)聽器,因?yàn)樗鼒?zhí)行OnCheckedChangeListener 分界面(通過(this))。 cb=(CheckBox)findViewById()。 在 Java中,你可以調(diào)用: ? isChecked() to determine if the checkbox has been checked ? setChecked() to force the checkbox into a checked or unchecked state ? toggle() to toggle the checkbox as if the user checked it 此外,當(dāng)復(fù)選框的狀態(tài)發(fā)生改變時(shí),你可以注冊(cè)一個(gè)偵聽器(這種情況下,一個(gè) OnCheckedChangeListener實(shí)例)來(lái)提醒。 另一種復(fù)選框 經(jīng)典的復(fù)選框有兩 種狀態(tài):選中的和未選中的。 圖 63 示例應(yīng)用程序的 FieldDemo 第 11 頁(yè) 共 35 頁(yè) 注意: Android的模擬器只允許在每一個(gè)獨(dú)特的 Java包發(fā)射器中應(yīng)發(fā)射用。 setContentView()。 import 。 隨著標(biāo)準(zhǔn) TextView屬性(例如, Android:文本樣式), EditText有許多其 第 9 頁(yè) 共 35 頁(yè) 他方面可以幫助你創(chuàng)建字段,包括: ? android:autoText, to control if the field should pro
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1