android-constraintlayout

ConstraintLayout 1.1.0 different from 1.0.2, is it a bug?

这一生的挚爱 提交于 2019-12-07 04:12:05
问题 If I use 1.0.2, the 3 images' width is average, and the height of them is computed by the radio which I set. If I use 1.1.0, the height of them is 0dp and I can't see nothing, unless I set android:layout_height="match_parent" in the root ConstraintLayout . Is it a bug? Here is my code: <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/iv0" android:layout_width="0dp" android:layout_height="0dp"

ConstraintLayout layout_constraintHorizontal_bias seems not work

蹲街弑〆低调 提交于 2019-12-07 03:33:54
问题 This is my 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"> <EditText android:layout_width="150dp" android:layout_height="50dp" android:hint="please input test content" android:inputType="phone" android:textColorHint=

Add Constraint Layout Barriers Missing In Context Menu of Android Android Studio

 ̄綄美尐妖づ 提交于 2019-12-07 03:19:28
问题 I am currently going through a ConstraintLayout tutorial and stuck in a specific step (https://codelabs.developers.google.com/codelabs/constraint-layout/#10). The source is here (https://github.com/googlecodelabs/constraint-layout). Per instructions below, it says to add a vertical barrier but I do not see the add option in the menu. Actually the entire menu options look different. Where is the "Add Vertical barrier" menu? Right click on ConstraintLayout in the blueprint or the Component Tree

How to use layout_aspectRatio in the PercentRelativeLayout?

偶尔善良 提交于 2019-12-06 18:33:33
问题 I try to achieve a 16:9 aspect ratio on a view with the PercentRelativeLayout. So I have put this line in my build.gradle file: compile 'com.android.support:design:23.0.1' I use this layout: <android.support.percent.PercentRelativeLayout 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="wrap_content"> <ImageView android:layout_width="match_parent" app:layout_aspectRatio="178

Responsive layout on Android

你。 提交于 2019-12-06 15:36:50
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 Relative layout: image has set toRightOf/toLeftOf Constraint layout: "constraint arrows" go from image to

How can I set an ImageView's position dynamically in Constraint Layout

时光毁灭记忆、已成空白 提交于 2019-12-06 11:02:03
问题 I have a dynamically created ImageView in one Constraint Layout. Once I run the app the ImageView is showing on left top corner because no position is defined for the ImageView. How can I set the position(let's say CENTER) of the ImageView dynamically. I have written below code ConstraintLayout layout = (ConstraintLayout) findViewById(R.id.constraintLayout); ImageView imageView = new ImageView(ChooseOptionsActivity.this); imageView.setImageResource(R.drawable.redlight); layout.addView

ConstraintLayout in Cardview adding white space

故事扮演 提交于 2019-12-06 08:09:26
问题 I am trying to create a CardView that has a ConstraintLayout to organize some TextView . Sometimes it'll display as intended, but sometimes, it'll add extra white space such as when a keyboard is closed and ruin the layout. I have a GIF below showing the CardView working and not working in the same span of time. A code snippet for the relevant CardView is below. I use wrap_content to try to keep the CardView at the size I want, but it still expands. <android.support.v7.widget.CardView android

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

人走茶凉 提交于 2019-12-06 06:02:25
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:layout_constraintTop_toTopOf="parent"> </android.support.v4.widget.DrawerLayout> </android.support

Is Constraint Layout expensive compared to others?

青春壹個敷衍的年華 提交于 2019-12-06 04:14:44
When I realize ConstraintLayout has: better layout drag-drop better view relative set-up with better naming "top-toBottomOf" better layout construction with ratios and percentage-guidelines and much more cant state here or I just didn't know that I was always wanted to using it constantly because it is so comfortable.   Just like the title, I curious about did ConstraintLayout will give big performance impact when using it constantly? Statement your opinion and evidence will be appreciated. Editing are welcome if you have good edition/grammar, and down-voting please leave your conclusion below

ConstraintLayout does not ellipsize long text in TextView

白昼怎懂夜的黑 提交于 2019-12-06 03:02:39
问题 I have a TextView to the right of an image. I am trying to place some long text next to the image but this text should automatically end by adding "..." at the end. However, this does not work. I use this layout: <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="wrap_content" android:layout_marginBottom="8dp" android:layout