Sure... here it is

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  >
  <FrameLayout android:id="@+id/puzzle_view"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    >
  </FrameLayout>
</LinearLayout>

I have a class that extends the TableLayout. That is the class that
represents the puzzle view. It takes care of creating appropriate rows
and adding the gridview in the rows. Finally the tablelayout is added
to the framelayout.

The code for that is as follows
public class PuzzleView extends TableLayout {

public PuzzleView(Context context) {
    super(context);
  }

public void initializeTable() {
    TableRow row = new TableRow(getContext());
  GridView grid = new GridView(getContext());
  grid.setNumColumns(4);
  grid.setHorizontalSpacing(1);
  grid.setVerticalSpacing(1);
  int rowNum = 0;
  int colNum = 0;
  grid.setAdapter(new SubCubeAdapter(
      widgetFactory,
      rowNum, colNum));
  row.addView(grid);
  addView(row);
  }
}

Where subcubeadapter does nothing but just creates buttons for every
position.

On Dec 22, 6:09 pm, Mark Murphy <[email protected]> wrote:
> saurabh wrote:
> > I am trying to create a sudoku like look where instead of 9x9 the
> > whole thing is 8x8 and instead of 9 subcubes of 3x3 i have 4 subcubes
> > of 4x4. I could used a gridview of the whole thing but i wanted to
> > make the boundaries separating the subcubes thicker. I was hoping to
> > add the subcubes in rows and manipulate the border, padding etc. of
> > the tablerow to get the desired effect. I tried the same thing with
> > gridview inside gridview and that dint work out too.
>
> The problem is that GridView is an AdapterView, and so it can be a bit
> more sensitive to its container than some other widgets.
>
> Can you post your layout XML that is not working?
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.9 Available!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to