1

I have three buttons in one row within a linear layout and just below a list is placed within another linear layout. I want to place some part of one button (like an arrow) in the first item of the list . (To indicate that the list is result for the button clicked). How it possible? plz help . I want to do like the image given below.enter image description here

Zahidul
  • 389
  • 5
  • 15
  • Please post the code you already have to get the idea what you want to do and what you already did. – brummfondel Jun 28 '14 at 17:38
  • @brummfondel I have edited my question and attached an image what I want to do. – Zahidul Jun 28 '14 at 18:05
  • take relative layout with listview and 3 arrow message and play with its visibility – Parag Chauhan Jun 28 '14 at 18:20
  • It's not "some part of button". What you are thinking is impossible. It is simply an image (in ImageView) made to look like button. I think it's fairly easy now as everyone else has guided. use Images and make them Visible when certain item is clicked. – VipulKumar Jun 28 '14 at 19:57
  • I want to use background image for button with its arrow ((not the different image for arrow) and I want to place the arrow part of the selected button in the 1st row of the list view. thnx in advance. – Zahidul Jun 29 '14 at 08:55

2 Answers2

1

Idea for your view, Coding is your task.

Top Most Parent is RelativeLayout.

|----- Relative Layout.
        |--- LinearLayout-1 --> City, Country, Global ( all weight = 1 )
        |--- LinearLayout-2 --> ( layout_below="LinearLayout-1" )
                  |--- 3 x ImageView  ( all weight = 1, Gravity=Center )
                       |--- Use View.SetVisibility(View.Invisible) to show/hide
        |--- ListView --> ( layout_below="LinearLayout-1" ) // Still below LL1.

Floating View

VenomVendor
  • 15,064
  • 13
  • 65
  • 96
  • I want to use a background image with its arrow when it selected (not the different image for arrrow) and I want to place the arrow part of the button(selected) in the upper part of the list view(1st row). – Zahidul Jun 29 '14 at 08:51
  • @Zahidul If you want to achieve it that way, refer `@Kostya`'s answer, and give listivew `-ve margin`(the height of the arrow). – VenomVendor Jun 29 '14 at 15:48
0

Create one image with arrow pointing down at the center. When you click on any button, in your OnClickListener, add a code the replace the button image with this new image.

btnCity.setBackground(getResources().getDrawable(R.drawable.selectedbtnimage));

You will need to add some more code the reset the images of other buttons to origninal button images.

user1560133
  • 51
  • 1
  • 5