Android :: How Evenly Space Images In A ScrollView
Nov 11, 2010I want to evenly space a vertical row of images in a ScrollView. I'm telling my LinearLayout inside the ScrollView to fill_parent, but it's not, it's wrapping content.
View 1 RepliesI want to evenly space a vertical row of images in a ScrollView. I'm telling my LinearLayout inside the ScrollView to fill_parent, but it's not, it's wrapping content.
View 1 RepliesI was just trying out with table layout to display some data....The data is a 3 column data and i want that the columns should utilize the whole width available. But it seems that the layout XML code which i had used is just wrapping up the columns according to the content.
Layout XML code
CODE:.........
I took this through my telescope with the Incredible's camera. One of the good things about the tiny cameras in phones is that they can see through the eyepiece of my telescope. Don't expect to try this and get it perfect the first time. The Saturn picture took about 30 tries and lots of fiddling with the settings to get just right
View 49 Replies View RelatedI must be overlooking something real simple here, but i think i'm trying to do something fairly basic.. Simply retain the scrollbar position of a ScrollView on orientation change...
Here is the code for my onSaveInstanceState and onRestoreInstanceState.. sView is the container for the ScrollView layout. Within my scrollview is a linearlayout with a lot of textviews.
CODE:............
If I set a Toast with the values of sViewX and sViewY on the Restore, the values are kept and correct.
I just tried to do a sView.scrollTo(0,150); in my onCreate.. just to see if that would open the activity at 150px down, and it didn't. I think my issue has to do with the .scrollTo method.
I want some of the goodies in a ListView, like being able to use a ListAdapter, and item selection, etc, but I don't want the ScrollView portion of it. I want to implement that part myself, in a different way (why or how I do this isn't really the point of this question, so please don't ask "why"). Is there a way to have a ListView that's not in a ScrollView or has the scrolling disabled?
View 2 Replies View RelatedI have this layout that works correctly, a relative layout with a text view and two buttons spaced evenly below it.
CODE:........
But running layoutopt it says that "this TableRow layout or its TableLayout parent is possible useless".
Is there a way to do this layout then without the tables?
I am displaying a table of values in my android application, and would like the columns to be distributed evenly in terms of size , instead of sizing according to content. Been playing around with stretchColumns but couldn't manage to figure out the right combination.
View 2 Replies View RelatedI have the following layout which display 3 buttons on a row. how can i make it so that each button is evenly distributed across the row? Right now, they are all crowded in the center of the row.
CODE:...............................
I am developing a misterhouse frontend.
I have 9 image buttons that I want to be evenly spaced on all sides.
See http://onlamp.com/onlamp/2004/11/11/graphics/mrhousemain.gif . What layout and xml parameters do I use to achieve this?
I would like to have my list activity to display 2 items(title, content) in a single row. I have almost 10 rows to display like that. And I want the width of the columns to be equally spread out. I tried with linear layout and table layout, but I could not bring the columns equally sized. I am using the following layout. kindly help me and advice me on this....
code.............
I have a linear layout (oriented horizontally) that contains 3 buttons. I want the 3 buttons to have a fixed width and be evenly distributed across the width of the linear layout.I can manage this by setting the gravity of the linear layout to center and then adjusting the padding of the buttons, but this works for a fixed width and won't work for changing devices or orientations.
<Linear Layout android:id="@+id/LinearLayout01"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:gravity="center">
Button
android:id="@+id/btnOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="120dip"></Button><Button
android:id="@+id/btnTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="120dip"></Button>Button
android:id="@+id/btnThree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="120dip"></Button></Linear Layout>
I used a ScaleAnimation to make a timebar shrink in a game. When the current level was finished, I wanted the timebar to quickly shrink to the bottom. So what I did was that if 30% of the time had passed, I assumed that 30% of the timebar was gone. So I just started a new ScaleAnimation that started at 70% of the timebars original size, assuming that this would look like a single smooth animation that speed up when the level was finished. Unfortunately the scaleanimation does not move evenly. It moves slower at the start and end, and faster in the middle.
So now I have three choices: Either I figure out how to make the ScaleAnimation move in an even speed, or I figure out the formula of how fast it moves, so I can determine exactly how big it is when a certain percent of the animation has played. Or, I find a smarter way altogether to do this timebar.
I'm basically using the same method of loading bitmaps in OpenGL that the SpriteMethodTest example uses and have been unable to get rid of an annoying outline that appears around all of my images.
For example, If I were to load an image of a white circle on a white background, I would expect to see nothing. Instead, I would see my circle because its edge would be gray. In SpriteMethodTest, I replaced the background image with white and was able to see that the edges of the android images flying around also don't seem to be rendered correctly.
Does anyone know how to load images in OpenGL without having a thin outline appear around the images?
I'm working to convert some background images to nine patch so they scale better on different phones.
The problem is that if I have the following resource structure: drawable-hdpi/background.png drawable-hdpi/button.png drawable-mdpi/background.png drawable-mdpi/button.png drawable-ldpi/background.png drawable-ldpi/button.png and then I drop a new drawable-hdpi/background.9.png file into the mix, it breaks button.png during the pre-compile. The error is "No resource found that matches the given name (at 'background' with value '@drawable/button').Simply removing that one nine patch file fixes the build. Should I be able to have some nine patch images and some normal ones, or to have nine patch only in hdpi but not mdpi or ldpi? This is Eclipse 3.5.1 with the latest ADT.
i got this notification yesterday so i deleted some apps and all my text messages but i cant get rid of it now!
any ideas?
So I just downloaded an app that quickly shows battery life, SD space, and disc space. It says I have used 628 of 748 mb on the disc. I thought the phone had an internal memory of 8gb.
View 3 Replies View RelatedJust curious how many have this issue.If you are unsure select the link below and find out pls.
View 30 Replies View RelatedHad my Samsung Moment for about a month. LOVE IT. Few issues (same as everyone else has noticed), but nothing terrible. Until: Randomly today TWO Notifications popped up that said "Low on space Phone storage space is getting low." One was what seemed to be from the "hardware" and the other was from the "Work Mail" app (which I don't use, haven't used, haven't even opened). When I click it, it takes me to the Manager screen. So, I began uninstalling some apps I don't really use (I didn't have that many anyway...a couple of games [Solitaire, etc], Facebook, Notes). It started running really slowly and random Force Close messages would appear for things like android.process, messaging--things that have never Force Closed before. I turned it off (pressed and held the red button), waited a few seconds, then turned it back on again. Immediately after the "Sprint" logo lights show finished, I got another Force Close message. When the Home Screen showed up, I had the two notifications again "Low on space". When I cleared the notifications, only the "Work Mail" one would clear. I went through and deleted some more apps that I don't use. Got on my computer & Googled the issue. Found a couple of random forums that suggested cleaning out the Cache in the Browser. I did that. Cleaned the History & Cookies in the Browser, too. Then, I did a soft reset (took out the battery). Started it up again, SAME notifications. Less Force Close messages. But, it's running VERY slowly.
After a few hours, I noticed that I hadn't received any text messages or Gmail notifications. I had my sister text me about 2 hours ago. Still have not received it.
I really don't want to hard reset. I haven't synced my contacts (I have over 400 & the Sprint store had trouble moving them from my Centro to the Moment) to Google yet, nor have I hooked my Moment up to my Mac yet (the Sprint guys had no idea if it would work or not with Snow Leopard & I hadn't had time to check yet) and I'm worried to try it now that my Moment has gone crazy...I really don't want to lose 400 contacts.I don't download a lot of apps. Most are reputable (Pandora, MotherTED, Shazam, Movies, Jewels). The last one I remember downloading was Google Voice three days ago (which I haven't really used because I've had the flu). I don't know if this is a Malware/Virus issue or if I'm just an idiot & did something wrong. But, it's running REALLY slowly right now. Still not receiving texts or emails (though my Twitter app has notified me of a couple of @ replies).I'm going to call Sprint & Samsung tomorrow, then go to a Sprint tech store if they can't help. But, I'm just hoping one of you have come across this & can help before I have to deal with hours of hold music & techies who tell me to soft reset over & over again.
BTW:
After awhile, I finally checked the storage space:
External SD care: Total: 1.89; Available: 1.85
Internal: About 2 hours ago when I first checked, after I had deleted a bunch of apps it said I had 7.something MB, now (after not downloading ANYTHING or barely even TOUCHING the damn thing) it says 1.95MB. Which leads me to believe that the 7.whatever was not necessarily accurate.
On Sunday I started getting the message "Low on space Phone Storage space is getting low." on the status bar. When I tap it, I'm taken to the "Manage Applications" screen, so it's clear that the message refers to the "Phone Memory," where apps are stored But when I go to Settings > SD card & phone storage here's what I see:
SD Card Total Space: 14.83GB
SD Card Available Space: 6.15GB
Internal Phone Storage Total Space: 6.60GB
Internal Phone Storage Available Space: 6.51GB
Phone Memory Total Space: 748MB
Phone Memory Available Space: 332MB
I've googled looking for solutions and it's obvious that this is a fairly common problem - especially on HTC phones. But the only possible solutions I've found are:
Too many apps are installed & space really is running low
A "bad" app was recently installed causing this error
Clear the cache for HTC Mail and HTC Message apps
Perform a Factory Reset We can rule this out since there is more than 44% of the Phone Memory available.
I didn't install any apps immediately before getting the message, but to be sure I uninstalled the 10 most recently added apps. No luck.
I've gone to Settings > Applications > Manage Applications, but the cache for these apps is already zero. The "Data" for Mail is 2.22MB and for Messages is 812KB.
This isn't fixing the problem, it's just a way to eliminate whatever condition has caused the symptom. But without an explanation of the actual problem I see no reason to think the problem won't come back in another two months.
My phone keeps telling me this in my notification bar and its bugging the crap out of me. My intenal phone storage has over 6gb free and my SD card has 1.3 gb free. The notification will not go away, I have tried rebooting my phone. I can't not stand it, its just one of my things, but it makes me want to not use my phone. OCD i guess.Anyway, PLEASE tell me why it is doing this
View 49 Replies View Related1.myJpegFile = new File("images/jpegImage.jpg");
2.output = new BufferedOutputStream(new FileOutputStream(myJpegFile));
3.encoder = JPEGCodec.createJPEGEncoder(output);
4.encoder.encode(myJpegImage); Please could you give me the equivalent code for line no. 3 and 4 in Android?
How to add listview inside scrollview ?
CODE:................
I added listview inside scroolview. But its not showing in proper way. The listview is showing only in smaller size.
I tried in most of the ways ? But i can't able to get...
I'm new to Android development and having a hard time making the UI, so hopefully someone here can help me with a hint...
What I need in my layout is this:
CODE:...............
as you can see the layout will need scrolling, but adding a scrollview as a root to the RelativeLayout tag, didnt do anything...
I've got a ScrollView containing a vertical LinearLayout.
The LinearLayout contains several items, including a ListView.
The problem is that I can't seem to get the ListView to be fully expanded. It is being compressed to fit everything on the screen, and forcing me to scroll through just the list. I would prefer to be able to scroll the entire layout, including the ListView.
I've played with the layout parameters a lot, but can't seem to get anything to work.
Also, I'm going to put this in another thread, but thought I'd ask here as well. Is there any way to force a separator at the top of a ListView?
I am trying to display a screen filled with data fetched from a server. The data, if it were HTML, would look something like the following (try to visualize =) ):
CODE:..............
So I naively tried to put a ListView in a ScrollView. Not only did it not work, but I've since read all about why it is bad by the likes of such luminaries as Hackborn and Guy (it nullifies the optimizations, etc).
Problem is, the half dozen places that said NOT to do it didn't recommend what I SHOULD do instead, excepting one post by Romain Guy specifying footer or header use (not suitable in my example, right?). In other words, it seems like people want to mix a list of items in among other text data, getting the benefits of a ListAdapter, but this isn't addressed anywhere that I can find.
So, what is The Right Way to implement my example above? I'm a step away from trying to add TextViews inside a for loop, which just doesn't sit right in my gut.
How can I add some buttons below ScrollView that always stay on screen.
View 3 Replies View RelatedI show articles in WebView and would like to add some additional information, e.g. publishing date, author etc., into the same ScrollView above the original content. So that it usually doesn't take up space, but the user can just scroll back when the information is needed.
Did any of you do something like that in a sane way?
I thought I can put my stuff into the same ScrollView that WebView uses, but when looking at it with hierarchyviewer I can't see any children, it's probably native.
I'm making sort of a book app. I have the text displayed as a textview in a scrollview:
CODE:.....
I then have
CODE:...............
And implemented the required following to catch a left fling or right fling. And
CODE:.......
This works fine if the text inside the textview is small (ie. there is no scroll bar as it all fits within the view). But as soon as the text requires scrolling, the gesture is no longer picked up by the detector. onFling is never called.
I have read that it is because scrollview handles its own gestueres? If so what is the easiest way to maintain the ability to scroll up and down the text, and also be able to detect flinging left or right and invoking nextChapter() and previousChapter() respectively?
I have two ScrollView inside of each of two HorizontalScrollView of a TableRow. When I touch drag one of ScrollView, another ScrollView must scroll as much. For instance, if I have a list of name on left ScrollView and corresponding phone numbers in right ScrollView, scrolling one ScrollView should not destroy the original bounding between the names and phone numbers. Can it be implemented by onTouchEvent? If so, how should I implement this(on both or one of the ScrollView)?
View 1 Replies View RelatedI want to use GridView with Scroll View(which containing ListView)..
View 3 Replies View Related