android-constraintlayout

I want View cover Button when View's parent layout is ConstraintLayout,but It's not the result I expect

谁说胖子不能爱 提交于 2019-12-23 12:24:35
问题 Here's the code inner file activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout 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"> <Button android:id="@+id/button" android:layout_width="0dp" android:layout_height="wrap_content" android:text="start" app:layout_constraintEnd_toEndOf="parent" app:layout

I want View cover Button when View's parent layout is ConstraintLayout,but It's not the result I expect

我是研究僧i 提交于 2019-12-23 12:21:53
问题 Here's the code inner file activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout 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"> <Button android:id="@+id/button" android:layout_width="0dp" android:layout_height="wrap_content" android:text="start" app:layout_constraintEnd_toEndOf="parent" app:layout

Constraint Layout measures incorrect height if it is nested into scrollview

冷暖自知 提交于 2019-12-23 09:38:36
问题 <android.support.v4.widget.NestedScrollView 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="wrap_content" android:fillViewport="true"> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content"> ///Content </android.support.constraint.ConstraintLayout> </android

Can't inflate ConstraintLayout

纵饮孤独 提交于 2019-12-23 07:40:47
问题 Each time my app crashes because it can't find Landroidx/constraintlayout/widget/R$styleable in classpath. I tried to rebuild, invalidate cache but it always gives me the same error in runtime. I tried both versions 1.1.2 and 1.1.3. And interesting: when using 1.1.3 androidX Jetifier just forces using 1.1.2 as you can see from gradle report Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.constraintlayout.widget

How to best place my obscured ProgressBar on a ConstraintLayout on the screen?

Deadly 提交于 2019-12-23 07:39:03
问题 I have a progress bar that shows up when I click on the Login button. I made modifications to the layout by adding a Toolbar at the top and it seems this toolbar is now obscuring the progressbar. How can I make this progress bar visible somewhere in the center of the screen? Thank you very much for your help. The layout xml code is as shown below: activity_login.xml <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http:/

How to overlay a view in a constraintlayout?

£可爱£侵袭症+ 提交于 2019-12-23 07:18:31
问题 I have this layout of my login activity. I want to overlay progressBar as like it can be done using FrameLayout . How to do this using ConstraintLayout ? <layout> <data> <variable name="vm" type="com.app.android.login.vm" /> </data> <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=

android ConstraintLayout height percentage 0.99

江枫思渺然 提交于 2019-12-23 02:58:06
问题 When app:layout_constraintHeight_percent is 0.50 or 0.80 it works fine, but when I set it to 0.99 , the Button go very long and larger than 99% of screen ? <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:fillViewport="true" android:orientation="vertical"> <android.support.constraint.ConstraintLayout android:orientation="vertical" android

Responsive layout on Android

孤街浪徒 提交于 2019-12-23 02:42:11
问题 I have three elements in layout, two TextViews and one ImageView between them. I'm trying to achieve this behavior: image (arrow) has 9patch image is wide as possible image has set minimal width right and left texts go wider with longer text but only to meet image's minWidth, then new line appears Below are few screenshots from Android Studio layout preview, gained with different layouts. What I have tried: Relative layout: image centered, minWidth set, texts have set toRightOf/toLeftOf

DrawerLayout inside ConstaintLayout - java.lang.IllegalArgumentException: DrawerLayout must be measured with MeasureSpec.EXACTLY

本小妞迷上赌 提交于 2019-12-22 16:52:28
问题 Here my xml layout file: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout 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.support.v4.widget.DrawerLayout android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app

Adding constraints to a view in a ConstraintLayout ignore left and right margins

做~自己de王妃 提交于 2019-12-22 09:28:51
问题 I want to add some views to a ConstraintLayout in java. This is the layout xml: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/constraint_layout" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> </android.support.constraint.ConstraintLayout> and this is the