I place 36 buttons on a 6x6 matrix on the screen. between the buttons there is a gap-white stripes. How can someone get rid of them? size of pictures in files png 66x106
RelativeLayout rl= (RelativeLayout) findViewById(R.id.rl); for (i=.... { ... mButton[ind[i]] = new ImageButton(mContext); mButton[ind[i]].setImageResource(drawableId); mButton[ind[i]].setLayoutParams(new LinearLayout.LayoutParams(wb, hb)); mButton[ind[i]].setId(drawableId); mButton[ind[i]].setX(x); mButton[ind[i]].setY(y); rl.addView(mButton[ind[i]]); x += wb; // wb=66 y += hb; // hb=106 ...... }
layout.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" android:id="@+id/rl" tools:context=".GameActivity" android:orientation="vertical"> </RelativeLayout>