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

正文內(nèi)容

android系統(tǒng)外文翻譯3-android-文庫(kù)吧資料

2025-01-27 06:37本頁(yè)面
  

【正文】 le, 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 。 } public void onClick(View view) { updateTime()。(this)。 setContentView()。 public class NowRedux extends Activity implements { Button btn。 import 。 import 。 This is the same setContentView() we used earlier, passing it an instance of a View subclass (in that case, a Button). The Androidbuilt view, constructed from our layout, is accessed from that codegenerated R class. All of the layouts are accessible under , keyed by the base name of the layout file— results in . To access our identified widgets, use findViewById(), passing in the numeric identifier of the widget in question. That numeric identifier was generated by Android in the R class as (where something is the specific widget you are seeking). Those widgets are simply subclasses of View, just like the Button instance we created in Chapter 4. The Rest of the Story In the original Now demo, the button’s face would show the current time, which would reflect when the button was last pushed (or when the activity was 第 22 頁(yè) 共 35 頁(yè) first shown, if the button had not yet been pushed). Most of that logic still works, even in this revised demo (NowRedux). However, rather than instantiating the Button in our activity’s onCreate() callback, we can reference the one from the XML layout: package 。 你可能會(huì)如前所述用禁用插件來(lái)使用,以確保一旦您禁用操作完成,正確的部件具有焦點(diǎn)。這是禁用一個(gè)復(fù)選框或單選按鈕選擇一些小部件的常用方式。 所有部件,包括以前的那些示例,擴(kuò)展視圖,這樣使所有部件一系列有用的性能,并超越那些已經(jīng)介紹的方法。如果您指派一個(gè) android:在您的 XML布局中 ID到你的RadioGroup,您可以訪問(wèn)您的 Java代碼和調(diào)用組: ? check() to check a specific radio button via its ID (., ()) 第 15 頁(yè) 共 35 頁(yè) ? clearCheck() to clear all radio buttons, so none in the group are checked ? getCheckedRadioButtonId() to get the ID of the currentlychecked radio button (or 1 if none are checked) 例如, the Basic/ RadioButton的示例應(yīng)用程序,這里是一個(gè) XML布局顯示一個(gè) RadioGroup包裝的 RadioButton的部件集合: ?xml version= encoding=utf8? RadioGroup xmlns:android= android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent RadioButton android:id=+id/radio1 android:layout_width=wrap_content android:layout_height=wrap_content android:text=Rock / RadioButton android:id=+id/radio2 android:layout_width=wrap_content android:layout_height=wrap_content android:text=Scissors / RadioButton android:id=+id/radio3 android:layout_width=wrap_content android:layout_height=wrap_content android:text=Paper / /RadioGroup 圖 66顯示了使用 Android生成的 Java項(xiàng)目和此布局的結(jié)果 第 16 頁(yè) 共 35 頁(yè) 圖 66 示例應(yīng)用程序的 RadoiButtonDemo 請(qǐng)注意,單選按鈕組最初設(shè)置為在一開(kāi)始就完全暢通無(wú)阻。 大多數(shù)時(shí)候,你會(huì)想要在 RadioGroup里面放進(jìn)一個(gè) RadioButton的小部件。因此,所有的標(biāo)準(zhǔn) TextView的字體,樣式,顏色等特性,可用于控制單選按鈕的外觀。 第 13 頁(yè) 共 35 頁(yè) 圖 64 CheckBoxDemo示例應(yīng)用程序,未選中的復(fù)選框 第 14 頁(yè) 共 35 頁(yè) 圖 65 同樣的應(yīng)用,選中的復(fù)選框 打開(kāi)收音機(jī) 由于與其他單選按鈕在其他工具包執(zhí)行時(shí), Android的單選按鈕是兩種狀態(tài),如復(fù)選框,但可分為這樣,只有一組中的單選按鈕可以隨時(shí)選中。在這種情況下,我們更新了文本的復(fù)選框來(lái)反映復(fù)選框中包含的實(shí)際內(nèi)容。 } } } 請(qǐng)注意為復(fù)選框的狀態(tài)變化 activity作為其自身監(jiān)聽(tīng)器,因?yàn)樗鼒?zhí)行OnCheckedChangeListener 分界面(通過(guò)(this))。 } public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { (This checkbox is: checked)。 cb=(CheckBox)findViewById()。 Override 第 12 頁(yè) 共 35 頁(yè) public void onCreate(Bundle icicle) { (icicle)。 在 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è)偵聽(tīng)器(這種情況下,一個(gè) OnCheckedChangeListene
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1