Home > Mobile >  Android ever like GroupBox in other programming languages or Panel controls?
Android ever like GroupBox in other programming languages or Panel controls?

Time:11-26

In other programming languages, such as Delphi, c #, etc., have a GroupBox, Panel, or TabSheet, put many controls can be used as a container for the developers, then according to the conditions set which container can be seen, very convenient to get data,

In the AS, seems not to have these things, only fragments seems to act AS the role (need to cooperate TabLayout, ViewPager), but the fragments and the main Activity by value and very trouble, such AS the need to each Fragment there is a value used to trigger the button, but not my fragments inside button, only the Activity have a save button, and how to pass the value?

I am AS a novice, there are a lot of immature ideas, please don't joke, have a good solution, please give directions, thank you very much!

CodePudding user response:



See a lot of online posts, are there is a value used to trigger the action in fragments of button, the save button above, for example, means to inform the main Activity: I have completed the information collection, now send a value to you, please receive, as without the trigger action, the values in the main Activity can't get fragments!

However, there is a button in each Fragment, feel redundant, I don't need, because the Lord confirm button in the Activity, can judge which one is currently fragments, and then use any way to get the value of the inside, I don't know what to do,

CodePudding user response:

CodePudding user response:

All the layout is written to the activity you are ok, why write separately

CodePudding user response:

reference ink_s reply: 3/f
that all layout is written to the activity you are ok, why the separate written?

Because the option, control, wrote in the Activity, the value is convenient, and put is necessarily overlap, seems not convenient

CodePudding user response:

Why not use popup window to try? Support and Activity interaction, and the effect is very good

CodePudding user response:


You can use the include tag, write different layout to different XML document total;

With PopupWindow should be can also, but generally there PopupWindow has certain, cancel button callback value, direct PopupWindow pop-up window, click the button in the activity to make PopupWindow disappear, and button click event to take effect, listening PopupWindow setOnDismissListener correction value, can also be so, may not be how specification,


CodePudding user response:

Try it with pop-up, support, and the Activity interaction operation and convenient use, mainly the effect is better, you can give it a try

CodePudding user response:

Take a look at to try

CodePudding user response:

Suggest directly use the Delphi, c + + Builder, a set of source code compiled directly to the Windows and macOS, iOS, Android, Linux

CodePudding user response:

To learn!!!!

CodePudding user response:

If you have any understanding, the Delphi Pascal or c + + language, written in Delphi or c + + Builder mobile app very convenient also,
A new version of c + + Builder RAD Studio can write android, apple app, more than a set of code compilation platform, can be compiled to first Windows convenient debugging and testing,

  • Related