free alignment of the controls and fixing their position

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How can you assign a position for a control in a way that it is fixed there even in the scroll view?

there is a possible solution?
1
50%
the challenge is impossible?
1
50%
there is a tricky way to achieve this?
0
No votes
 
Total votes : 2

free alignment of the controls and fixing their position

Postby abhsax130778 » Thu Jul 09, 2009 11:26 am

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4.        
  5.  
  6. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  7.  
  8.         android:orientation="vertical" android:layout_width="fill_parent"
  9.  
  10.         android:layout_height="fill_parent" android:background="@drawable/splash"
  11.  
  12.         >
  13.  
  14.         <ImageView android:id="@+id/titlebar" android:layout_width="wrap_content"
  15.  
  16.                 android:layout_height="wrap_content" android:src="@drawable/banner" />
  17.  
  18.         <ListView android:id="@+id/mainuilist" android:layout_height="wrap_content"
  19.  
  20.                 android:layout_width="fill_parent" />
  21.  
  22.         <ImageButton android:id="@+id/basebar" android:src="@drawable/basebar"
  23.  
  24.                 android:layout_width="wrap_content" android:layout_height="40dip"
  25.  
  26.                 />
  27.  
  28. </LinearLayout>
  29.  
  30.  
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


Problem: As you can see I have added three controls in my Activity. What the requirement is that I want to keep the Lower bar static i.e. however the middle list is big, the third control should be immovable on the list scroll, as the first control.
Can the combination of more than one layout can be used to achieve that?

I have another problem, but I think that might have been discussed here already, and that is I want to know how many types of layout are available in Android.
Attachments
ActivityProblem.PNG
This will make the problem clear to understand
ActivityProblem.PNG (50.25 KiB) Viewed 182 times
Thanks and regards
Abhinav
abhsax130778
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 09, 2009 6:11 am
Location: NOIDA, UP, India

Top

Postby abhsax130778 » Fri Jul 10, 2009 8:19 am

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4.         <!--
  5.  
  6.                 Copyright (C) 2007 The Android Open Source Project Licensed under the
  7.  
  8.                 Apache License, Version 2.0 (the "License"); you may not use this file
  9.  
  10.                 except in compliance with the License. You may obtain a copy of the
  11.  
  12.                 License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
  13.  
  14.                 by applicable law or agreed to in writing, software distributed under
  15.  
  16.                 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  17.  
  18.                 CONDITIONS OF ANY KIND, either express or implied. See the License for
  19.  
  20.                 the specific language governing permissions and limitations under the
  21.  
  22.                 License.
  23.  
  24.         -->
  25.  
  26. <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
  27.  
  28.         android:orientation="vertical" android:layout_width="fill_parent"
  29.  
  30.         android:layout_height="fill_parent" android:background="@drawable/splash">
  31.  
  32.         <TableRow android:paddingTop="0px">
  33.  
  34.                 <ImageView android:id="@+id/titlebar" android:layout_width="323px"
  35.  
  36.                         android:layout_height="40px" android:src="@drawable/banner"
  37.  
  38.                         android:adjustViewBounds="true"
  39.  
  40.            
  41.  
  42.                          />
  43.  
  44.         </TableRow>
  45.  
  46.         <TableRow android:paddingTop="0px">
  47.  
  48.                 <ListView android:id="@+id/mainuilist" android:layout_height="354px"
  49.  
  50.                         android:layout_width="323px"
  51.  
  52.                        
  53.  
  54.                        
  55.  
  56.                          />
  57.  
  58.         </TableRow>
  59.  
  60.         <TableRow android:paddingBottom="0px">
  61.  
  62.                 <ImageButton android:id="@+id/basebar" android:src="@drawable/basebar"
  63.  
  64.                         android:layout_width="323px" android:layout_height="40px"
  65.  
  66.                         android:adjustViewBounds="true"
  67.  
  68.            
  69.  
  70.                         />
  71.  
  72.         </TableRow>
  73.  
  74. </TableLayout>
  75.  
  76.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4

------------------
You change the above XML and the problem is solved.
But still the q remains. I have to specify 6 extra pixels as the calculations say for the middle view.
Attachments
MainUiList.png
and here is the support for the solution.
MainUiList.png (47.81 KiB) Viewed 166 times
Thanks and regards
Abhinav
abhsax130778
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 09, 2009 6:11 am
Location: NOIDA, UP, India

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 11 guests