First on the map, right:
Brother wanted to be able to make a bottom 3 button can right slide (appear from the left) out of a new button, and type these three Button same.
You can use HorizontalScrollView brother found to achieve, but with a lower initial, seemingly written inside xml if the four, it will all show up, and there is no arrangement stays full screen, you can not do what I said above that effect.
Here you requested Android guru, can be achieved using HorizontalScrollView I say this practice? How 4 BUTTON to add in order to achieve "show three, another hidden, and must hide on the left" Such UI? Or three stays over the entire screen, you need to calculate the width of the device itself?
original 3 BUTTON own painted in full support xml:
android: layout_gravity = "bottom"
android: orientation = "horizontal"
android: layout_width = "match_parent"
android: layout_height = "wrap_content">
android: id = "@ + id / network_button"
android: layout_width = "match_parent"
android: layout_weight = "1"
android: layout_height = "wrap_content"
android: text = "@ string / network_button"
android: drawableTop = "@ drawable/network_1" android: background = "@ drawable / selector" android: textColor = "@ color / title_text_white" />
android: layout_width = "2sp"
android: layout_height = "match_parent"
android: background = "@ drawable / shape" />
android: id = "@ + id / setting_button"
android: layout_width = "match_parent"
android: layout_weight = "1"
android: layout_height = "wrap_content"
android: text = "@ string / scanner_setting_button"
android: drawableTop = "@ drawable / scanner_setting_up" android: background = "@ drawable / selector" android: textColor = "@ color / title_text_white" />
android: layout_width = "2sp"
android: layout_height = "match_parent"
android: background = "@ drawable / shape" />
android: id = "@ + id / scan_button"
android: layout_width = "match_parent"
android: layout_weight = "1"
android: layout_height = "wrap_content"
android: drawableTop = "@ drawable / scan_disabled"
android: text = "@ string / scanner_scan_button" android: textColor = "@ color / title_text_gray" android: background = "@ color / transparent_background_black" />
Thank you! !
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
I've done a similar effect, with HorizontalScrollView in sets a GridView, and then dynamically set the horizontal length of the GridView.
RelativeLayout item = (RelativeLayout) inflater.inflate (R.layout.filter_item, null);
ImageView show = (ImageView) item.findViewById (R.id.imageview);
width = show.getLayoutParams ();
width = length width * data;
vGridView.setLayoutParams (new LinearLayout.LayoutParams (width,
LayoutParams.WRAP_CONTENT));
Reply:
Thank you for your answer, looked under your code, first read the whole (3 Button) the layout, and then get the imageview to be displayed?
Then set to go?
width = width * length of data; What is the role of this code is?
I am a bit puzzled T T
Reply:
The equivalent of your 4 Button width. You can according to their own requirements of the width
Reply:
What someone can give suggestions
No comments:
Post a Comment