Android Studio - TextView not showing in design view layout - android

I am brand new to trying out an android app. I started to follow the online tutorial (https://developer.android.com/training/basics/firstapp/building-ui), but getting a bit frustrated at adding a new TextView, as according to the tutorial, it should show in design view, and let me move it around. It is invisible to me in design view though, and I can only see it by running an emulation. Please can someone let me know if I am doing something wrong? or something the tutorial does not tell you? or is this just a bug?
Thank you in advance for any advice you can offer.

There is a bug in latest sdk 28 ,
Change the compileSdkVersion 27
targetSdkVersion 27
and
implementation 'com.android.support:appcompat-v7:27.1.1'
Update:
This is said to fix problem but I did not test it yet
In styles.xml change the parent theme for your app to Base.Theme.AppCompat instead of Theme.AppCompat

I faced this issue too, this is a issue from the latest support.appCompact.
Inside gradle dependencies if your using,
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
change to
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
This will fix the issue

You see it in the component tree so, if you want to modify or delete it, you can do that from there.

First and foremost, check to see if your dependencies match your SDK level. To check this, go to your app.gradle file and check every highlighted statement for version conflicts.
If this doesn't work, your next debugging step should be to restart your Android studio. Since the view shows in your component tree (and in your emulator), it ought to show in your preview. Previews in android studio lag sometimes due to various reasons (mostly machine related).
If it still doesn't show up after restarting, the problem might be a larger scale IDE issue and you should consider updating your question accordingly.
I hope this helps.. Merry coding!!

Found an easier way than adding code or changing SDK. It is just hidden and you have to show it by checking the "Show layout Decorations"
Hope it helps.
P.S. it also solves the hidden toolbar problem Picture of where to find it

Related

ConstraintLayout doesn't match with the screen size

I just started my first Android Studio project and I already come with a problem :)
I search on google for the answer but didn't find my problem.
So I need your help please ^^
I download the last version of Android Studio, create a project with an Empty Activity and I came up with this
As you can see my ConstraintLayout is really small and I just can't work with this.
I didn't touch anything on the project. Just to be sure I create 3 projects that have the same issue and redownload 4 time Android Studio.
On the virtual Devices, it looks correct throw: Screenshot
I put the XML code just in case it can help
xmlcode
Hope I was clear and sorry for my English ;)
EDIT: For some reason, the constraint layout fit correctly on the watch screen, but I don't want to create a watch app x) screenshot_watchview
Ok so I have finally find the problem ! I'm so happy right now :D
The problem was the AppTheme theme that I use, I switch it with the DeviceDefault theme. I don't know why this theme was causing problem but now it work and I can finally work on my first Android App !
If you are using the supportLibrary 28+ then this thing happened to me too.
and when I change the support lib version to the 27, it works.
Maybe this is a possible bug in the support library 28+.
Changing the AppTheme works like a charm if you want to stick with the support library 28+ But if you still don't want to so Try using the support library below 28.

How I can understand where is the conflict in libraries version?

Suddenly after I start using constraintLayout I got an error. I know that error is because of support library version. And I have already checked two main answers on stack. But anyway I got a question:
Is it ok that it add library with another version by itself?
How can I fix that? I need to put each library from left to right side and give it needed version?
Do I need to change versions of each file or I just need to add implementations on the right side?
I need to change versions here?
Or add it here
Thats the error
I know about - Go and ready about Gradle - I am already doing that:) Thank you for your time guys!

android material design issue

i am trying to solve a issue for last 1 week. i am not sure what is wrong with the code.
i am trying to use this library https://github.com/rudsonlive/NavigationDrawer-MaterialDesign
I can able to compile and run the code
the issue is ,there is big difference in the display quality
clearly we can notice the font is completely not matching.
please help me to resolve this.
You should use Android Design Support Library to achieve this.
It's quite easier and will surely fix your problem.
Check this official sample to learn how to use this:
https://github.com/chrisbanes/cheesesquare
Omg i cannot believe it. the actual problem with me is eclipse.
I use android design support library and all other needed libraries.
i only can manage to run the project but when i imported the project using android studio everything is working fine without any additional work.
dam it.
any one tired with eclipse ?

Rendering problems, could not find android.support.v4.widget.Drawerlayout

I have tried each and every solution from the SO, but my problem still isn't solved. Following is the error I am getting:
The following classes could not be found:
- android.support.v4.widget.DrawerLayout (Fix Build Path, Create Class)
Tip: Try to build the project.
I am just exporting this android project into android studio(1.2).
I have applied this solution and many other , but with no success.
Android Studio's XML editor preview will give you that error whenever you use a "custom" view - be it third-party library views or Google's own DrawerLayout, as you've experienced yourself.
But fear not, that error will only be shown on the XML preview, your project should compile just fine. Go ahead and try. :)
Hope this helped!
p.s., Switching API level on the editor (as suggested by an answer here) helps fix API 22 rendering error for "normal" in-build views, but not for DrawerLayout or any other third-party views really.
You Need To change the API level from 5.1.1 to 5.0.1.it is on upper right side corner in design of xml.:)

Android Manifest: configChanges:screenSize is not available

I have strange issue. And normally on strange issues I've done something really stupid. But this I have absolutely no clue what could be wrong.
I added
android:configChanges="orientation"
to the activity section of my app to prevent the refresh of the listview on screen rotation. This worked pretty well, but after targeting sdK-Version 15, the ListView is refreshing again. I read some more lines and noticed, that I also have to add screenSize attribute for sdK targets 13 and above.
But there is no attribute "screenSize" available in my Eclipse (smallestScreenSize is also missing). I have installed every available sdK incl the Google api's since Version 7.
Please has someone an idea, how to fix that?
Thank u very much in advance!
Best regards
Tobi
Right click your Android Project, click Properties, navigate to Android, and then select Android 4.0.3. If you haven't already.
If screenSize and smallestScreenSize still don't show up, then doing a Project --> Clean and restarting eclipse. Not sure what the problem would be otherwise...

Categories

Resources