Я ищу, чтобы создать этот макет в приложении для Android. Как мне это сделать? Есть ли какой-либо существующий код для макета этого типа?Как мне сделать этот макет?
-4
A
ответ
1
На самом деле это довольно простой макет, единственная проблема заключается в том, чтобы сделать FAB между двумя видами.
Не забывайте compile 'com.android.support:design:22.2.0'
в граде.
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/viewA"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.6"
android:background="#acacac"
android:orientation="horizontal"/>
<LinearLayout
android:id="@+id/viewB"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.4"
android:background="#bebebe"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="30dp"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="20dp"
android:layout_marginEnd="20dp"
android:src="@drawable/ic_palette_grey600_24dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="20dp"
android:layout_marginEnd="20dp"
android:src="@drawable/ic_palette_grey600_24dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="City"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="20dp"
android:layout_marginEnd="20dp"
android:src="@drawable/ic_palette_grey600_24dp"/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Address"/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/array"
android:prompt="@string/prompt"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
android:src="@drawable/ic_add_white_24dp"
app:borderWidth="0dp"
app:backgroundTint="@android:color/holo_green_dark"
app:layout_anchor="@id/viewA"
app:layout_anchorGravity="bottom|right|end"/>
</android.support.design.widget.CoordinatorLayout>
дает этот результат (моделирование фильеры и EditText на вас - это на апи 18):
0
Вы посмотрите на реализацию Криса BaneS в новой библиотеке дизайна Google может. https://github.com/chrisbanes/cheesesquare. Особенно проверьте this layout, у него есть некоторые части от макета, которые вы приложили.
Смежные вопросы
- 1. Как мне сделать этот макет CSS?
- 2. Как сделать этот макет (фото)
- 3. Как сделать этот макет прокрутки?
- 4. Как мне сделать этот макет? У меня так много проблем
- 5. Как мне сделать этот макет в CSS, дивы рушатся
- 6. Как сделать этот макет GUI в Swing
- 7. Как сделать этот макет в Bootstrap 3?
- 8. Как сделать этот макет по дисплею: table
- 9. Как сделать этот макет в кристаллическом докладе
- 10. Как сделать этот макет Android более «отзывчивым»?
- 11. Как программно сделать этот автоматический макет?
- 12. Как сделать этот макет в Android XML
- 13. Как сделать этот макет с помощью flexbox?
- 14. Как сделать этот макет в CSS?
- 15. Как сделать этот макет в bootstrap3?
- 16. Как получить этот макет?
- 17. Как получить этот макет?
- 18. Как создать этот макет?
- 19. Как создать этот макет
- 20. Как выполнить этот макет?
- 21. Как реализовать этот макет
- 22. Каков наилучший способ сделать этот макет?
- 23. Java Как мне сделать этот флаг?
- 24. Как мне сделать этот веб-сервис?
- 25. Как мне сделать этот запрос в mysql
- 26. Как бы мне лучше сделать этот SEO_able?
- 27. Как мне сделать этот анимированный эффект подчеркивания?
- 28. Как мне сделать этот код NSPredicate?
- 29. Как мне вставить макет и какой макет?
- 30. Как сделать обо мне макет с использованием начальной загрузки