Unable to deploy Android Studio textview

Asked 1 years ago, Updated 1 years ago, 112 views

https://codinginflow.com/tutorials/android/simple-recyclerview-java/part-1-layouts-model-class

Like around 4:14 in the video here, even if I drag textview with my mouse, it goes back to the upper left. Is there any solution?The code is exactly the same...

java android android-studio xml

2022-09-30 18:18

1 Answers

In my environment (Android Studio 3.6RC1/Linux) I copied and moved the example_item.xml on the page you mentioned. It is a bit old code, so I need to change the reference to CardView to androidx.cardview.widget.cardView in the latest version, but there was no particular problem with the editor.Please check the following:

  • Does imageView exist? Is 'layout_toEndOf' correctly specified from textView?
    It seems that this xml is specified relative to imageView.To make it easier to understand, it is easier to understand if you use xml in blue print mode.(The image will not appear on the screen unless you specify it in design mode, so you can copy and paste it as I tried.)
  • I don't think it's a direct cause, but are the libraries and views up to date?
    Support library class names have been replaced significantly to migrate to androidx.


2022-09-30 18:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.