Reputation: 75
My problem I created an app in the android studio, its .xml file (design) is not visible although its text is visible to me, Please provide a solution
Here is how it looks:
my text file(.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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.52" />
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberDecimal"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="148dp"
tools:layout_editor_absoluteY="137dp" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="217dp"
tools:layout_editor_absoluteY="67dp" />
///Please provide solution for this
Upvotes: 0
Views: 7196
Reputation: 795
make sure you have added below dependency in your build.gradle(Module:app) file.
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
Upvotes: 0
Reputation: 1550
Try changing your API Version in Editor
EDIT
Try syncing project
Upvotes: 0
Reputation: 470
I think the solution for your problem is just change the theme of your style from
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
change to
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.NoActionBar">
Upvotes: 1