I've used a FAB (Floating action button) in my app.
It stays Extended when i click on the other parts of page or changing tabs.
How can i make it embed on changing tabs or clicking on the other parts?
May be you have done mistake in your Layout XML file. Check the FAB Width & Height Property. it should be wrap_content in both.
also if you share your code we can give you proper guide.
Related
I'm using Appcelerator's Titanium Alloy to work on an app that features both a tab-group on the bottom of the screen and a toolbar on the top of the screen. These both will appear after login, and won't change until logged out. I have been able to create both the tab-group and the toolbar, but am having trouble having them both on the screen.
The toolbar that I'm going for is something similar to this:
How to create a header bar with buttons in Titanium JS?
Just a guess, but I think the views of the tab-group and the toolbar are getting overlapped with one another. As such, I'm only able to see one at a time, always the one I set second (i.e. it is on top of the other bar).
Any help/ideas are greatly appreciated.
Thank you!
Edit:
I've looked into adjusting the leftNavButton and rightNavButton properties, but to use this method would require each individual tab to be adjusted, instead of the entire tab group. I'd like to find a way to add these buttons universally, as the top and bottom bars do not change with different views.
You can use the rightNavButtons and leftNavButtons properties of the windows to add buttons to the navigationBar that is showing at the top of the screen in a tabgroup.
I have implemented the ActionBar using v7 support library. The content of the activity below the actionbar are some textviews, editexts and a button.
Now when I tap on the edittext, the keyboard appears and that makes the actionbar moving up and out of the screen. I want the position of the actionbar to be fixed and only the content to scroll up or down as and when required with out affecting the actionbar (like the gmail app in android phones.).
How to achieve that?
Thanks in advance.
Well, I think, I should answer the question with the new understanding of the problem and the solution and to explain the issue to the new user. I did not land on the right link (answer) earlier, because I was of the notion that this is strictly an ActionBar related issue.So my searches were with those sort of keywords not having edittext.
But as rightly pointed by Fllo and this link
the issue was related to Android system's handling of input and re-sizing of activity.
So the solution is:
step-1) setting windowSoftInputMode attribute to adjustResize.
<activity ........... android:windowSoftInputMode="adjustResize"/>
step-2) above step would fix the position of action bar but, the text entered from the keybaord won't be visible when the layoutout is bigger then the screen can adjust. To make the edittext (or other input widgets) and text being typed on it, the layout should be made scrollable by wrapping in a ScrollView.
<ScrollView> your_layout ...</ScrollView>
Now the action bar is fixed. Also the input widget becomes visible as the android system scroll it up above the keyboard to make the text you type visible.
i'm building an app and i really want to align buttons to the left using ABS (action bar sherlock) 4.0
I really like the dropbox interface as shown under this:
So, my question is: How can i align the buttons to the left and how can i jump between views in ViewFlow using buttons?
I've seen that people can add tabs to their ABS, but not with the title like the Dropbox interface.
Thanks.
Also if u need my sourcecode i will add it later if needed.
Regards
Stian Instebø
setCustomView() is the magic method you might be looking for.
To achieve the same layout shown in the Dropbox app, you would first call setDisplayShowHomeEnabled(false) on your ActionBar.
Next, you could define the layout for the buttons somewhere in XML. Once this is done, calling setCustomView(R.layout.my_actionbar_nav) will do the trick. (It will now be positioned on the left-hand side of the ActionBar).
It'll be your responsibility to wire up the appropriate onClick listeners for your layout's inner button Views, but it's not a bad price to pay for setting up custom navigation.
I am looking to create a Nav Bar in my Android application that functions very similar to the Nav Bar used by the Netflix app. There will be 4 buttons aligned horizontally. When one of those buttons is selected, the appropriate activity loads and that button is replaced by an image.
There are multiple ways I can achieve this, but since I am new to programming for Android, I figured I'd ask the community first. I list the first two that come to my head below.
Create a Linear Layout and define a separate layout for each activity. The Layout would include two more linear layouts, a horizontal linear layout for the nav bar and a vertical layout for the content.
Create a custom ui component named nav bar that extends a linear layout (based upon earlier threads I have seen about nav bars on here). Inflate that layout for each activity, then make a framelayout that overlays an image on top of the active button (the button that was just pressed). Then create onButtonClick listeners for each button except for the active button.
I'm not sure if there is a better way to achieve this and I am open to any suggestions. Any feedback would be great.
I'm not sure how the netflix app looks, but you might want to check out ye good olde tab-layout? ( http://developer.android.com/resources/tutorials/views/hello-tabwidget.html )
Also be sure to take a look at the android design page: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
I have created custom component with a Button Bar on the Bottom of
the screen and a Title and status bar on the top of the screen. I want
to include this custom component in every one of my Activities. Now,
in a any given activity, how do I go about adding content on the
screen (say a button in the middle of the screen) in a addition to my
custom component thats ever present?
How about adding a base layout with can contain the header and footer that you use everywhere and then have a stub in the middle that you can inflate with whatever you like?
I think that will solve your problem.
You can read about ViewStub here:
http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-with.html