I'm trying to create a ViewPager that takes up the entire screen. Inside each fragment of the ViewPager, I have an ImageView that displays a semi-transparent picture.
For some reason, when I try my solution on a Galaxy Nexus (4.0.4), it leaves a border on the left and right side of the ViewPager, as shown below:
I've tried this on the following devices and it does not give that problem:
Nexus S (4.1.1)
Nexus One (2.3.6)
Evo 4G (CM7.2, 2.3.7)
Android emulator
Would anyone be able to take a look at the simplified source code and help me out (especially if you have a Galaxy Nexus)? Thanks!
Btw, this is an attempt to solve an earlier question myself, for which I couldn't get a proper answer.
I went through my code again and tried commenting/uncommenting sections to see if I could get rid of the problem.
I narrowed it down to the custom style I was applying to my activity. In it, I had the following item:
<item name="android:windowIsFloating">true</item>
Removing this item fixed the issue, although I still don't understand why. Maybe something related to this question - How to create a transparent activity WITHOUT windowIsFloating
I had originally included this item after reading the following question -
How do I create a transparent Activity on Android?
Anyway, I hope this saves someone else a significant amount of time in debugging.
Related
Is there a quick and easy way to see how my application will look on different screen sizes and shapes? Currently, I'm going into the AVD manager, editing my device definition, and then launching a fresh emulator. It takes maybe ten minutes for each one.
They layout is defined entirely from resource files. I don't actually need to execute the app. Is there a faster way to do this?
Edit: I should add: there are some custom widgets in the app.
While looking at a layout open the "Design" tab or open the "Preview" tab on the side. On the top of the window you will see a list where you can change the layout and orientation.
May not solve your entire issue, but it's a good to know.
If you want to have a preview of a static page (not rendered at runtime, like recyclerview), you could use android studio to do that.
So, first of all I'm very new to Android so this may be a very dumb question, but..
I have in my mainActivity layout a viewPager which calls some fragments of different type (I have made 4-5 xml layout displaying different informations)
Despite I created all the layout basing on weighed LinearLayout to maximize compatibility, in the preview the visibility seems perfect in each device I selected, but once I load the application on my phone, the layout has bizarre behavior.
Here an example (preview vs. screenshot from my device)
I'm not sure about where I made the mistake, I would like to know:
1) What happened
2) What cause this behaviour
3) How to fix it (a link with a guide would be very welcome)
Thanks very much!
Hey guys I am trying to get multiple layouts previews for a single app in the Graphical view in eclipse for android. like how our layour would look on different screen sizes.
here is how it looks
Hope someone will help me out with this...
Also I have searched here before posting but didnt get it so dont down rate please.
Thanks
In the image below, click where the arrow is pointing to and select "Preview All Screen Sizes"
I guess that's a little hard to see but its the little page icon right next to "Pallete" on the top-left. Its the layout configuration drop-down.
you can add more previews and show all of the previews, as shown on the google IO video:
http://www.youtube.com/watch?v=Erd2k6EKxCQ
it's shown on 20:30
I'm developing an android app. So far I've been testing everything on my Galaxy Nexus with android 4+. I've done all my programming with backwards compatibility in mind.
I'm very close to release, and want to make sure that it runs okay on API 9+. Since I don't have a real android 2.3 phone, I'm using the emulator.
Everything seems to work fine, but the layout is sometimes okay, and sometimes completely garbled!
The background is horrible, and TextViews are a lot of times missing. But sometimes they're okay for just a few moments before garbling up.
How reliable is this emulator? Is this how it would really look if I ran it on a real machine? What can cause this?
EDIT:
The layout in the screenshot is made up of 7 small ViewGroups containing ListViews.
This is the code for the main background drawable (the blue-green-gray garbled one):
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="#drawable/main_bgtile"
android:tileMode="repeat" />
EDIT2:
I also noticed that when a transaction animation when switching fragments is played, the fragments look perfect for the duration of the animation, and then re-garble when it's done.
EDIT 3:
My logcat seems to be flooded with the following error:
10-09 00:41:40.385: D/skia(327): SkGL unimplemented: stroke path
A few dozens of those. What should I do to fix this?
Thanks
I solved it:
I'm using actionbarsherlock; and for some reason I decided to disable the actionbar in the style, but then re-request it in the activity.
By removing this line from my onCreate() method in my activity, I was able to solve the problem:
this.getWindow().requestFeature(Window.FEATURE_ACTION_BAR)
Has anyone had any success with TabWidget.setDivider()? I'm not sure it does what I'm assuming: gives you a chance to supply a drawable to be drawn between each tab instance?
mTabHost.getTabWidget().setDividerDrawable(R.drawable.dividerDrawable);
this does not appear to do anything. Looking at the tab drawable resources in the android project shows that the dividers are actually drawn into the tab images themselves - is this supposed to work or is it not supported?
Call that before you set the content of the tabs.Or It would crash.
similar answer is here