Форум программистов, компьютерный форум, киберфорум
Программирование Android
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.82/11: Рейтинг темы: голосов - 11, средняя оценка - 4.82
1 / 1 / 1
Регистрация: 16.09.2016
Сообщений: 23
1

Отображение floating action button квадратной формы

08.01.2018, 12:43. Показов 2073. Ответов 1

Author24 — интернет-сервис помощи студентам
При добавлении fab в layout она становится не круглой, а квадратной. В чем проблема? Спасибо заранее за помощь.

build.gradle

XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
apply plugin: 'com.android.application'
 
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.hfad.constraintliving"
        minSdkVersion 23
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
 
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.1.0-beta4'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:design:26.1.0'
}
AndroidManifest.xml

XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hfad.constraintliving">
 
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity"
            android:theme="@style/Theme.AppCompat">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
 
</manifest>
activity_main.xml

XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
idth="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_begin="16dp" />
 
    <android.support.constraint.Guideline
        android:id="@+id/guideline2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.95555556" />
 
    <TextView
        android:id="@+id/additional_info"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:text="@string/film_info"
        app:layout_constraintEnd_toStartOf="@+id/guideline2"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toEndOf="@+id/imageViewPoster"
        app:layout_constraintTop_toBottomOf="@+id/textViewMovieHeading"/>
 
    <android.support.constraint.Barrier
        android:id="@+id/barrier"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:barrierDirection="bottom"
        app:constraint_referenced_ids="imageViewPoster,additional_info"
        tools:ignore="MissingConstraints"
        tools:layout_editor_absoluteX="16dp"
        tools:layout_editor_absoluteY="128dp" />
 
    <Button
        android:id="@+id/rent_button"
        style="@android:style/Widget.Material.Button.Colored"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:text="@string/rent"
        app:layout_constraintEnd_toStartOf="@+id/buy_button"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintHorizontal_chainStyle="spread_inside"
        app:layout_constraintStart_toStartOf="@+id/guideline"
        app:layout_constraintTop_toTopOf="@+id/barrier"
        tools:targetApi="m" />
 
    <Button
        android:id="@+id/buy_button"
        style="@android:style/Widget.Material.Button.Colored"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="@string/buy"
        app:layout_constraintEnd_toStartOf="@+id/guideline2"
        app:layout_constraintStart_toEndOf="@+id/rent_button"
        app:layout_constraintTop_toTopOf="@+id/barrier"
        tools:targetApi="m" />
 
    <android.support.design.widget.FloatingActionButton
        android:id="@+id/floatingActionButton4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:clickable="true"
        android:focusable="true"
        android:src="@android:drawable/checkbox_on_background"
        app:layout_constraintStart_toStartOf="@+id/guideline"
        app:layout_constraintTop_toBottomOf="@+id/rent_button" />
 
</android.support.constraint.ConstraintLayout>
Миниатюры
Отображение floating action button квадратной формы  
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
08.01.2018, 12:43
Ответы с готовыми решениями:

Floating action button
Я, особо не верю, но вдруг кто-то уже делал такое...

Android Floating Action Button со счетчиком
Здравствуйте. Делаю FAB со счетчиком, вот разметка: &lt;RelativeLayout...

Floating Action Button (Плавающая кнопка)
Столкнулся с необходимостью создания этого элемента в интерфейсе. Возможно кто-то реализовывал...

Создание объекта "action" типа "button" определенного назначения
Всем доброго времени суток, уважаемые пользователи форума!!! Суть в следующем. Есть форма...

1
35 / 35 / 2
Регистрация: 12.11.2013
Сообщений: 345
09.01.2018, 11:01 2
Может нужно поставить круглый фон?
0
09.01.2018, 11:01
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
09.01.2018, 11:01
Помогаю со студенческими работами здесь

Отправка формы методом GET, используя атрибут action формы
Язык HTML. Задача состоит в том чтобы при выставленном методе отправки данных с формы &quot;post&quot;...

Asp-controller to ActionLink или button anchor tag helpers asp-action
public class PaginatedList&lt;T&gt; : List&lt;T&gt; { public int PageIndex { get; private set; }...

Action у формы с параметрами
&lt;form action=&quot;http://test/index.php?get=1&quot; method=&quot;get&quot;&gt; &lt;input type=&quot;submit&quot;...

Тег action для формы
Пишу пробную задачку(упражнение), поставил IIS, htm страничку отобразить - 0 проблем. Но вот...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
2
Ответ Создать тему
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru