Câu hỏi được gắn thẻ «android-layout»

Bố cục xác định cấu trúc trực quan cho giao diện người dùng, chẳng hạn như giao diện người dùng cho một hoạt động, đoạn hoặc tiện ích ứng dụng.


6
Ai đó có thể giải thích attr?
Tôi đang xem mã mẫu Thư viện tổ ong ( tại đây ) và tôi đã xem qua mã sau khi cố gắng thêm các mục hành động trong ứng dụng của riêng mình: <item android:id="@+id/camera" android:title="Camera" android:icon="?attr/menuIconCamera" android:showAsAction="ifRoom" /> Tôi ?attrđang ném cho tôi một vòng lặp. Ai đó …


8
Cách ủy quyền để ghi đè onMeasure ()?
Cách chính xác để ghi đè onMeasure () là gì? Tôi đã thấy nhiều cách tiếp cận khác nhau. Ví dụ: Professional Android Development sử dụng MeasureSpec để tính toán các thứ nguyên, sau đó kết thúc bằng lệnh gọi setMeasuredDimension (). Ví dụ: @Override protected void onMeasure(int widthMeasureSpec, int …

4
Hoạt ảnh tỷ lệ hình ảnh Android liên quan đến điểm trung tâm
Tôi có ImageView và tôi tạo một hoạt ảnh tỷ lệ đơn giản cho nó. Mã rất chuẩn. Scale_up.xml của tôi: <set xmlns:android="http://schemas.android.com/apk/res/android"> <scale android:fromXScale="1" android:fromYScale="1" android:toXScale="1.2" android:toYScale="1.2" android:duration="175"/> </set> Mã hoạt ảnh của tôi: Animation a = AnimationUtils.loadAnimation(this, R.anim.scale_up); ((ImageView) findViewById(R.id.circle_image)).startAnimation(a); Vấn đề: Khi hình ảnh chia tỷ lệ, …






3
Làm thế nào để hiển thị một bố cục trên đầu trang kia theo chương trình trong trường hợp của tôi?
Bố cục chính của tôi main.xml chỉ chứa hai LinearLayouts: Máy LinearLayoutchủ thứ nhất a VideoViewvà a Button, Máy thứ 2 LinearLayouttổ chức một EditTextvà điều này LinearLayoutđã đặt giá trị hiển thị thành " GONE " ( android:visibility="gone") như dưới đây: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" > <LinearLayout android:id="@+id/first_ll" …

2
Android: Điền Spinner từ mã Java theo lập trình
Làm cách nào để bạn điền một spinner từ mã java theo lập trình? Tôi có một con quay trong bố cục như thế này: <Spinner android:id="@+id/consultation_deseases" android:layout_width="@dimen/bigSpinnerWidth" android:layout_height="@dimen/bigSpinnerHeight" android:prompt="@string/disease_prompt" /> Với mã java, tôi cần tạo bộ điều hợp và thêm các mục.

8
Glide-4.0.0 Thiếu trình giữ chỗ, lỗi, GlideApp và không giải quyết trình giữ chỗ phương thức của nó, lỗi
Tôi muốn sử dụng thư viện Glide Android để tải xuống hình ảnh và hiển thị trong ImageView. Trong phiên bản trước, chúng tôi đã sử dụng: Glide.with(mContext).load(imgUrl) .thumbnail(0.5f) .placeholder(R.drawable.PLACEHOLDER_IMAGE_NAME) .error(R.drawable.ERROR_IMAGE_NAME) .crossFade() .diskCacheStrategy(DiskCacheStrategy.ALL) .into(imageView); Nhưng tôi đã xem tài liệu Glide: nó nói sử dụng GlideApp.with()thay thếGlide.with() Mối quan tâm …

22
Làm cách nào để tắt tất cả các chế độ xem bên trong bố cục?
Ví dụ tôi có: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/backbutton" android:text="Back" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <LinearLayout android:id="@+id/my_layout" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/my_text_view" android:text="First Name" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <EditText android:id="@+id/my_edit_view" android:width="100px" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <View .../> <View .../> ... <View .../> </LinearLayout> </LinearLayout> Có cách nào để tắt (setEnable (false)) tất …


Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookieChính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.