I was just searching for an answer to this question and this was one of the first results. In this example the buttons are also in a linear layout because it is easier to put them side by side at an equal size. The best way is a relative layout that sets the buttons below the listview. ListParams.addRule(RelativeLayout.ABOVE, buttons.getId()) RelativeLayout.LayoutParams listParams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT) tLayoutParams(new LinearLayout.LayoutParams(45, LayoutParams.FILL_PARENT)) ImageButton newLayer = new ImageButton(this) RelativeLayout.LayoutParams bottomNavParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) īottomNavParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM) īottomNavParams.addRule(RelativeLayout.CENTER_HORIZONTAL) ītLayoutParams(bottomNavParams) LinearLayout buttons = new LinearLayout(this) ![]() Here's my current code: RelativeLayout container = new RelativeLayout(this) ĬtLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)) It seems like it should be so easy, but everything I've tried has failed. And can't seem to find a way to have a listView, with a row of buttons at the bottom so that the listview doesn't extend over top of the buttons, and so the buttons are always snapped to the bottom of the screen. ![]() For example, if I have a product in the list, i want to click the button and display the information for that specific product when i click the button.Alright, this specific layout is just annoying me. I’m trying to get a listView to have a button that corresponds to each item on the listView.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |