TAILIEUCHUNG - Lập trình Androi part 15

Trong ví dụ trước, các nội dung của mỗi tab được thiết lập để được một View, chẳng hạn như một Button. Điều này là dễ dàng và đơn giản, nhưng nó không phải là lựa chọn duy nhất. Bạn cũng có thể tích hợp các hoạt động khác từ ứng dụng của bạn thông qua một Intent | CHAPTER 9 Employing Fancy Widgets and Containers Intents and Views In the preceding examples the contents of each tab were set to be a View such as a Button. This is easy and straightforward but it is not the only option. You can also integrate another activity from your application via an Intent. Intents are ways of specifying something you want accomplished and then telling Android to go find something to accomplish it. Frequently these are used to cause activities to spawn. For example whenever you launch an application from the main Android application launcher the launcher creates an Intent and has Android open the activity associated with that Intent. This whole concept and how activities can be placed in tabs is described in Chapter 18. Flipping Them Off Sometimes you want the overall effect of tabs only some Views visible at a time but you do not want the actual UI implementation of tabs. Maybe the tabs take up too much screen space. Maybe you want to switch between perspectives based on a gesture or a device shake. Or maybe you just like being different. The good news is that the guts of the view-flipping logic from tabs can be found in the ViewFlipper container which can be used in other ways than the traditional tab. ViewFlipper inherits from FrameLayout in the same way you use it to describe the innards of a TabWidget. However initially the ViewFlipper container just shows the first child view. It is up to you to arrange for the views to flip either manually by user interaction or automatically via a timer. For example here is a layout for a simple activity Fancy Flipper1 using a Button and a ViewFlipper xml version encoding utf-8 LinearLayout xmlns android http apk res android android orientation vertical android layout_width fill_parent android layout_height fill_parent Button android id @ id flip_me android layout_width fill_parent android layout_height wrap_content android text Flip Me ViewFlipper android id @ id details .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.