android-layout

How to achieve this layout in Jetpack Compose

社会主义新天地 提交于 2021-02-09 08:18:22
问题 I'm trying to use the new Jetpack Compose UI framework, but i'm running into an issue. I'd like to achieve this layout, wich in xml is pretty easy to achieve: But i can't figure out hou to make the vertical divider take up the available vertical space, without specifying a fixed height. This code that I've tried doesn't seem to work: @Composable fun ListItem(item: PlateUI.Plate) { Surface( modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(8.dp), elevation = 2.dp ) { Row( modifier

How to achieve this layout in Jetpack Compose

女生的网名这么多〃 提交于 2021-02-09 08:18:01
问题 I'm trying to use the new Jetpack Compose UI framework, but i'm running into an issue. I'd like to achieve this layout, wich in xml is pretty easy to achieve: But i can't figure out hou to make the vertical divider take up the available vertical space, without specifying a fixed height. This code that I've tried doesn't seem to work: @Composable fun ListItem(item: PlateUI.Plate) { Surface( modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(8.dp), elevation = 2.dp ) { Row( modifier

How to achieve this layout in Jetpack Compose

て烟熏妆下的殇ゞ 提交于 2021-02-09 08:17:41
问题 I'm trying to use the new Jetpack Compose UI framework, but i'm running into an issue. I'd like to achieve this layout, wich in xml is pretty easy to achieve: But i can't figure out hou to make the vertical divider take up the available vertical space, without specifying a fixed height. This code that I've tried doesn't seem to work: @Composable fun ListItem(item: PlateUI.Plate) { Surface( modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(8.dp), elevation = 2.dp ) { Row( modifier

How to achieve this layout in Jetpack Compose

淺唱寂寞╮ 提交于 2021-02-09 08:17:13
问题 I'm trying to use the new Jetpack Compose UI framework, but i'm running into an issue. I'd like to achieve this layout, wich in xml is pretty easy to achieve: But i can't figure out hou to make the vertical divider take up the available vertical space, without specifying a fixed height. This code that I've tried doesn't seem to work: @Composable fun ListItem(item: PlateUI.Plate) { Surface( modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(8.dp), elevation = 2.dp ) { Row( modifier

TextInputLayout error: Couldn't resolve resource @string/path_password_strike_through

主宰稳场 提交于 2021-02-08 21:33:13
问题 AndroidX: I'm trying to use a TextInputLayout but when I put it in my XML I receive this error: Render Problem: Couldn't resolve resource @string/path_password_strike_through Failed to initiate one or more classes The following classes could not be instantiated: com.google.android.material.textfield.TextInputLayout Here the Stack Trace: java.lang.AssertionError: error in parsing "g/"java.lang.NumberFormatException: For input string: "/" at android.util.PathParser_Delegate.getFloats(PathParser

TextInputLayout error: Couldn't resolve resource @string/path_password_strike_through

我的未来我决定 提交于 2021-02-08 21:32:10
问题 AndroidX: I'm trying to use a TextInputLayout but when I put it in my XML I receive this error: Render Problem: Couldn't resolve resource @string/path_password_strike_through Failed to initiate one or more classes The following classes could not be instantiated: com.google.android.material.textfield.TextInputLayout Here the Stack Trace: java.lang.AssertionError: error in parsing "g/"java.lang.NumberFormatException: For input string: "/" at android.util.PathParser_Delegate.getFloats(PathParser

Background image in constraints layout does not work

天涯浪子 提交于 2021-02-08 20:54:37
问题 I want my app to use a image in the background for signup and signin function. I am using android studio 2.3 and so far I can see that lot many things have changed since last year. Where we used relative or linearlayout now that is constraint layout. I included a code with the root layout as: android:background="@drawable/wallpaper_2" android:orientation="vertical" Check this image for more information: When I test this app on my Nexus 5 it does not show anything just a blank screen but the

Android ImageView not loaded

孤人 提交于 2021-02-08 13:01:10
问题 I am using the android imageView and I put the the image into the drawable folder, and changed the imageView source to that image. But it does not show the image in the Preview panel and when I open the picture in the android studio,it show the error like this. But I can open the picture on my computer desktop. so why there is the error and how to solve it? 回答1: Sounds like piac.png was not a .png file, you just slapped a .png extension on it and expected it to become a .png file. The problem

Multi-windows in Android 7.0 - Always get landscape layout even though device in multiwindows portrait mode

时间秒杀一切 提交于 2021-02-08 10:30:45
问题 I am developing an android application that supports multi-windows feature on Android 7.0. I followed this guide on https://developer.android.com. , imported sample project https://github.com/googlesamples/android-MultiWindowPlayground I create a new resource named layout-land and did some testing. I recognized that landscape layout is inflated even though the device is in portrait mode. Check out attached images. How can I set portrait layout when device is in portrait mode. 回答1: Assume you

How to support different screen size in android using dimensions?

喜你入骨 提交于 2021-02-08 10:00:11
问题 I am developing an android app where i have 40 xml layouts. Previous projects i was using multiple folders to support multiple screen but now i have 40 layouts its difficult to create different folder. i heard about dimensions but i don't know how to achieve that .can any one provide some code or example Thank you Before asking this question i read following answer but it is asked in 2013. Different resolution support android 回答1: If you have ten Buttons and one TextView in your layout, then