Design tabhost in Eclipse - android

I have a question that I think is really easy answer if you know, how to I change the visible tab in Eclipse while developing the GUI in Ecplise?
I can add tabs and add stuff to the outline and change it but I can't figure out how to change what Tab that is visible in the development view, I can only see the first tab...
(If I move the tab I'm about to develop to first position the I can see you not the right way I guess?)
Have search google and forum but no luck so far.
Thanks in advance
Best regards
Oskar Norin
Sweden

The only way I can see of how to go about doing this is to create each tab in its own xml layout file and then join them together using the include tag in the xml to link to that tab.
Something like:
<include
android:id="#+id/tab4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="#layout/tab4" />
This way you just switch to the layout you want to design and it gets included automatically. Not ideal but it works.

Related

Creating a circular tab host in android

Firstly, I would like to mention that since i am not sure of the terminology of the view that i am looking for so I shall try and explain the behaviour.
I am looking for build a screen with multiple tabs where the tab indicators do not fit all inside the screen so it is scrollable. This is fine but i want that when the scrolling happens, after the last tab indicator, the tab widget automatically shows the first tab indicator right after it. So kind of like a circular tab widget.
Could someone please give pointers on how this could be achieved in android.
Thanks,
Sunny
I'm not sure, since you're not so clear...but i think you're looking for this:
https://github.com/astuetz/PagerSlidingTabStrip
Sliding tabs like the ones in Google Play.

setting my main project default to linear instead of relative

Everytime I follow a tutorial book or you tube video, I have also used the cheat help in eclipse. My programming always comes out with errors. here is one example why does all the tutorials main activity comes out showing linear layout and my projects default is relative layout. So how do I change the default to linear when creating new project.
I know I can open a new layout xml but all the tutorials opens a new project in linear.
I am a massive fan of android and I really want to make some apps, but all the tutorials never seem to correspond with the results I get and they all make it look so easy.
go to youre layout.xml
make sure to be in the graphical layout (check bottom bar)
top-right in 'outline' right-click on the relative layout
choose 'change layout'
choose youre desired layout, (linearlayout(vertical) probably in ur case)
I found it after digging a lot in Android Studio After visiting JetBrains and Intelij documentation and help sections i found nothing much helpful but i found way on my own, I had answered it here, With all explanation and screenshots.

Using ViewSwitcher with Eclipse IDE

I am new to android programming, and I am using eclipse.
I am using ViewSwitcher, and able to switch back and forth between views.
My question is with eclipse.
In eclipse, how can I edit the different layouts graphically? Only the first layout is visible when I select the res->layout->main.xml.
I know there is a work around (or may be even the right approach); having two layout files, and switching between them. But that is not my intention right now.
Thanks for any suggestions.
Karthik
Its a bit late but I had the same problem and got around it with only xml changes by putting the contents of the 2 layouts in other files and including them in the original file. Not sure if this is proper but it made it easier to test.
<ViewSwitcher
android:id="#+id/detailSwitcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<include
layout="#layout/layout_file_1" />
<include
layout="#layout/layout_file_2" />
</ViewSwitcher>
I would not create a view graphically. It is really easy to type in the XML and then you know you are making exactly what you want. Use the GUI to check your work. I would certainly build the two layouts in separate files and then paste them into the one with the view switcher when you have it just as you want it.
You just have to change the sequence of the layouts in the view switcher. The first layout in the viewswitcher is visible in eclipse. Edit your first layout which is in the viewswitch and then move the second up to work on it.

How can I remove the space between tab widget?

I would like to know how to remove space between tab widgets,Am new to android.
Please see this question. He basically says create your own drawables without padding. Did you google this at all? I searched for "android remove space between tab widget" and the first link brought that question up.

how to show all of my component in the tab layout?

i am facing a problem and wish you help me..
i am using tabs in my code and and i added a lot of component in it (Buttons , ImageButtons, etc..) and i put this layout in the center of the screen and here is the problem because not all my component appear in my layout (some buttons appears and others not and i can't see
it or deal with it).
So can i shrink the component or customize it to appear fine?
iam using TableLayout to manage the component then i added this layout in the corresponding tab ..
can you help me in that?
thnaxx in advance.
Give same weight to component in xml file .
i.e.
android:layout_weight="1"
Hope it will solve the problem

Categories

Resources