TAILIEUCHUNG - Lập trình Androi part 07

Nếu bạn thích các bảng HTML, lưới bảng tính, và như thế, bạn sẽ đánh giá cao TableLayout của Android, cho phép bạn đến vị trí các vật dụng của bạn trong một lưới điện thông số kỹ thuật của bạn. Bạn kiểm soát số lượng các hàng và cột, cột có thể thu nhỏ hoặc căng ra để chứa nội dung của họ, và như vậy. | android layout_toRightOf @id label android layout_alignParentTop true Button android id @ id ok android layout_width wrap_content android layout_height wrap_content android layout_below @id entry android layout_alignRight @id entry android text OK Button android id @ id cancel android layout_width wrap_content android layout_height wrap_content android layout_toLeftOf @id ok android layout_alignTop @id ok android text Cancel RelativeLayout With no changes to the autogenerated Java code the emulator gives us the result shown in Figure 6-6. Figure 6-6. The RelativeLayoutDemo sample application Tabula Rasa If you like HTML tables spreadsheet grids and the like you will appreciate Android s TableLayout which allows you to position your widgets in a grid to your specifications. You control the number of rows and columns which columns might shrink or stretch to accommodate their contents and so on. CHAPTER 6 Working with Containers TableLayout works in conjunction with TableRow. TableLayout controls the overall behavior of the container with the widgets themselves poured into one or more TableRow containers one per row in the grid. TableLayout Concepts and Properties For your table layout you need to figure out how widgets work with rows and columns plus how to handle widgets that reside outside rows. Putting Cells in Rows Rows are declared by you the developer by putting widgets as children of a TableRow inside the overall TableLayout. You therefore control directly how many rows appear in the table. The number of columns is determined by Android you control the number of columns in an indirect fashion. First there will be at least one column per widget in your longest row. So if you have three rows one with two widgets one with three widgets and one with four widgets there will be at least four columns. However a widget can take up more than one column by including the android layout_span property indicating the number of columns the widget spans. This is akin to the

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.