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.



3
Xem trước bố cục với thẻ gốc hợp nhất trong Intellij IDEA / Android Studio
Hãy tưởng tượng chúng ta đang phát triển thành phần hỗn hợp dựa trên linearLayout. Vì vậy, chúng tôi tạo ra lớp như thế này: public class SomeView extends LinearLayout { public SomeView(Context context, AttributeSet attrs) { super(context, attrs); setOrientation(LinearLayout.VERTICAL); View.inflate(context, R.layout.somelayout, this); } } Nếu chúng tôi sử dụng …


3
Đường viền trong hình xml
Tôi đang cố gắng tạo ra một drawable để sử dụng cho một nút. Tôi muốn nó có màu này, với đường viền 2px xung quanh nó. Mọi thứ đều hoạt động tốt, ngoại trừ tôi không thể xuất hiện đường viền ... <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > …




4
java.lang.NullPulumException: Cố gắng gọi phương thức ảo 'int android.view.View.getImportantForAccessibility ()' trên tham chiếu đối tượng null
Tôi đang cố gắng kết hợp một ứng dụng danh sách mua sắm, dựa trên các trường đầu vào ArrayList, và ListView. Các ứng dụng sẽ được dựa trên Fragments. Tuy nhiên, tôi đã gặp phải một vấn đề và tôi không biết làm thế nào để giải quyết nó. …

15
Android - làm thế nào để tạo một ràng buộc có thể cuộn?
Tôi muốn tạo một bố cục cho phép tôi cuộn xuống bằng cách sử dụng bố cục ràng buộc, nhưng tôi không biết làm thế nào để đi về nó. Có nên ScrollViewlà cha mẹ của ConstraintLayoutnhư thế này? <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true"> <android.support.constraint.ConstraintLayout …

5
Android - Tự động thêm lượt xem vào chế độ xem
Tôi có một bố cục để xem - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="0px" android:orientation="vertical"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/items_header" style="@style/Home.ListHeader" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/items_none" android:visibility="gone" style="@style/TextBlock" android:paddingLeft="6px" /> <ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/items_list" /> </LinearLayout> Những gì tôi muốn làm, là trong hoạt động chính của tôi với một bố cục …





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.