java - How to dynamically insert a relative layout into a table layout -


I am a newbie for Android programming. I need a table layout that has 3 rows and 3 columns (maybe I'll change these numbers dynamically), with each cell row having a relative layout inside it. It's like a scene shown in Google Play Store, which shows new arrival on Play and more. I have tried to use the buttons to get it. But I want to extend an XML file, in which the relative layout is routed with an image view and textview. Is this possible? Or what is the best way to get such a layout? Also, how to get an image-visualization and text-picture of an inflated layout, so that I will add it to the program. This is what I have tried.

  Private Zero populateCategoryGrid () {Table layout categories; Table row line; Button btn_category; Int class = 12; Int NUM_ROW = range _mount / 3; Integer NUM_COL = range _mount / 4; {Line = new tablet (this) for (interior r = 0; r & lt; NUM_ROW; r ++); Row.setLayoutParams (New TableLayout.LayoutParams (TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.MATCH_PARENT, 1.0F)); CategoriesLayout.addView (line); For (int c = 0; c  

You did a lot of work by enlacing and enlarging buttons in rows is . Some adjustments have been made and you have:

  populated from Private Zero Grid () {Table layout categories layout; Int class = 12; Int NUM_ROW = range _mount / 3; Integer NUM_COL = range _mount / 4; Layout Inflighter Inflator = Layout Inflator. Frame (this); // to add rows (int r = 0; r  

Some notes:

  • Once you have a line after using a local variable for each TableRow You can not change anything inside this
  • Returns the Flat in Flat root view, in which you see findViewById any view in it

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -