I have a created a custom view , in relative layout .
I'm able to align it in in center/left/right through xml but not
programatically
.
Custom View
public class HotspotView extends RelativeLayout {
public HotspotView(Context context) {
super(context);
init(context);
}
public HotspotView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public HotspotView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
private void init(Context context) {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = layoutInflater.inflate(R.layout.hotspot_view, this);
}
}
Custom view xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/hotspot_imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/tohome"
/>
</RelativeLayout>
Activity xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/black"
>
<VideoView
android:id="#+id/vv_frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:clickable="true"
android:onClick="onclick"
android:visibility="gone" />
<ImageView
android:id="#+id/iv_frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:contentDescription="#string/content_description"
android:onClick="onclick"
android:scaleType="fitXY"
android:visibility="gone"
/>
<ImageView
android:id="#+id/lv_frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:contentDescription="#string/content_description"
android:onClick="onclick"
android:visibility="gone" />
<
<android.gesture.GestureOverlayView
android:id="#+id/gesture_area"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.0"
android:alpha="1.0"
android:background="#android:color/transparent"
android:gestureColor="#android:color/white"
android:onClick="onclick"
android:visibility="visible" />
<WebView
android:id="#+id/ticker_webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:visibility="gone"></WebView>
<WebView
android:id="#+id/wv_frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:adjustViewBounds="true"
android:onClick="onclick"
android:scaleType="fitXY"
android:visibility="gone"
/>
<ProgressBar
android:id="#+id/webview_progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:visibility="gone" />
<com.devstring.imageframe.views.HotspotView
android:id="#+id/hotspot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:visibility="visible" />
</RelativeLayout>
Code:
RelativeLayout.LayoutParams lp = new
RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
lp.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
ImageFrameActivity.hotspotView.setLayoutParams(lp);
ImageFrameActivity.hotspotView.setVisibility(View.VISIBLE);
I have gone through various similar questions but I'm not able to resolve the problem.
try this :
RelativeLayout.LayoutParams lp =
(RelativeLayout.LayoutParams) ImageFrameActivity.hotspotView.getLayoutParams();
lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
ImageFrameActivity.hotspotView.setLayoutParams(lp);
Try using
lp.gravity = Gravity.LEFT;
Related
I want to get this
Here is my xml layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:elevation="5dp"
app:cardCornerRadius="2dp"
android:layout_margin="2dp"
android:clickable="true"
android:foreground="?attr/selectableItemBackground">
<com.example.akash.music.view.SquareRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/img_button_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="right"
android:background="?android:selectableItemBackground"
android:padding="4dp"
app:srcCompat="#drawable/ic_clear_black" />
<TextView
android:padding="4dp"
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Hello"
android:textSize="#dimen/text_size_primary" />
<View
android:id="#+id/view"
android:layout_above="#+id/button_apply"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/colorBackground" />
<TextView
android:clickable="true"
android:padding="8dp"
android:textStyle="bold"
android:textSize="#dimen/text_size_primary"
android:id="#+id/button_apply"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:text="APPLY"
android:gravity="center"
android:layout_alignParentBottom="true"
/>
</com.example.akash.music.view.SquareRelativeLayout>
</android.support.v7.widget.CardView>
and here is SquareRelativeLayout.class
public class SquareRelativeLayout extends RelativeLayout {
public SquareRelativeLayout(Context context) {
super(context);
}
public SquareRelativeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SquareRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
#Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
setMeasuredDimension(widthMeasureSpec,widthMeasureSpec);
}
}
the problem is I'm not able to align APPLY button to the bottom of the SquareRelativeLayout. If I do, it becomes invisible.
Im having problem where the android scrollview starts hiding a pair of textviews (Top ~5-6 lines doesnt show). I use padding, margin, fillviewport, wrap in linearlayout, original scrollview etc. many variations but it didnt work. I check this problem both api 16 and 23.
Im working many hours but doesnt find solution.
dialog_base.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/base"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.AppCompatImageView
android:id="#+id/wallpaper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/panelAlt"
android:clickable="false"
android:focusable="false"
android:visibility="gone"/>
<include
layout="#layout/toolbar"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
<android.support.v7.widget.AppCompatTextView
android:id="#+id/topInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:layout_below="#id/toolbar"/>
<RelativeLayout
android:id="#+id/innerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/topInfo">
<!--Inner view-->
</RelativeLayout>
<LinearLayout
android:id="#+id/lyBottom"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|right"
android:layout_below="#+id/innerView"
android:animateLayoutChanges="true">
<android.support.v7.widget.AppCompatButton
android:id="#+id/b1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"/>
<android.support.v7.widget.AppCompatButton
android:id="#+id/b2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<android.support.v7.widget.AppCompatButton
android:id="#+id/b3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
dialog_checkbox.xml (this view inflate programmatically and adding in id: innerView layout from dialog_base.xml)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="#+id/scroll"
layout="#layout/scroll_and_text"/>
<android.support.v7.widget.AppCompatCheckBox
android:id="#+id/checkbox"
android:layout_below="#+id/scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"/>
</RelativeLayout>
scroll_and_text.xml
<?xml version="1.0" encoding="utf-8"?>
<app.CustomScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:fadeScrollbars="true"
android:scrollbarStyle="outsideInset"
android:scrollbarFadeDuration="3000"
android:fillViewport="true">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<android.support.v7.widget.AppCompatImageView
android:id="#+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginRight="16dp"/>
<android.support.v7.widget.AppCompatTextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</app.CustomScrollView>
CustomScrollView.java
public class CustomScrollView extends ScrollView {
private final int maxHeight = Utils.dptoPx(250);
public CustomScrollView(Context context) {
super(context);
}
public CustomScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
#Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
try {
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
if (maxHeight != -1 && heightSize > maxHeight) {
heightSize = maxHeight;
}
heightMeasureSpec = MeasureSpec.makeMeasureSpec(heightSize, MeasureSpec.AT_MOST);
getLayoutParams().height = heightSize;
} catch (Exception e) {
Log.print(e);
} finally {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
}
Thanks in advance!
This is my layout file:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:gravity="center_vertical">
<TextView
android:id="#+id/form_widget_switch_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toEndOf="#+id/form_widget_switch"
android:gravity="center"
android:text="text" />
<com.example.daffodil.formvalidation.widgets.typefaced.SwitchButtonTF
android:id="#+id/form_widget_switch"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:switchMinWidth="40dp"
android:textOff=""
android:textOn=""
android:thumbTextPadding="5dp" />
</RelativeLayout>
This is the output I'm getting:
Problem : I want text to be center vertically aligned but as you can see its top edge is aligned with top edge of the switch.
Edit: based on comments
Why am I using TextView : I want text view to move dynamically left or right side of the switch.so I use both TextView and Switch and changing their params dynamically to move text left or right.
I want output similar to setting Switch's button text attribute.
SwitchButtonTF class which presently I'm using:
/**
* Switch with typeface attribute added.
*/
public class SwitchButtonTF extends Switch {
/**
* {#inheritDoc}
*/
public SwitchButtonTF(Context context) {
super(context);
init(context, null);
}
/**
* Initialise view.
*
* #param context context
* #param attrs layout attributes
*/
private void init(Context context, AttributeSet attrs) {
if (!isInEditMode()) {
Fonts.getInstance(context).applyTypeFace(this, context, attrs);
}
}
/**
* {#inheritDoc}
*/
public SwitchButtonTF(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
/**
* {#inheritDoc}
*/
public SwitchButtonTF(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context, attrs);
}
}
Any help?
Just add android:layout_centerVertical="true" in your textview as it is inside the relativelayout.Also set the height of the textview to wrap_content.
So your textview xml should be
<TextView
android:id="#+id/form_widget_switch_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/form_widget_switch"
android:gravity="center"
android:layout_centerVertical="true"
android:text="text" />
Try this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/form_widget_switch_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/form_widget_switch"
android:layout_centerVertical="true"
android:gravity="center"
android:text="text" />
<com.example.daffodil.formvalidation.widgets.typefaced.SwitchButtonTF
android:id="#+id/form_widget_switch"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:gravity="center"
android:switchMinWidth="40dp"
android:textOff=""
android:textOn=""
android:thumbTextPadding="5dp" />
</RelativeLayout>
If you don't have any problem using LinearLayout in place of RelativeLayout then can you try this?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:orientation="horizontal">
<com.example.daffodil.formvalidation.widgets.typefaced.SwitchButtonTF
android:id="#+id/form_widget_switch"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:switchMinWidth="40dp"
android:textOff=""
android:textOn=""
android:thumbTextPadding="5dp" />
<TextView
android:id="#+id/form_widget_switch_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center|center_vertical"
android:text="text" />
</LinearLayout>
Edit - try this with RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:gravity="center_vertical">
<TextView
android:id="#+id/form_widget_switch_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="#+id/form_widget_switch"
android:gravity="center"
android:text="text" />
<com.example.daffodil.formvalidation.widgets.typefaced.SwitchButtonTF
android:id="#+id/form_widget_switch"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:switchMinWidth="40dp"
android:textOff=""
android:textOn=""
android:thumbTextPadding="5dp" />
</RelativeLayout>
I have created a custom view Game4 that extends LinearLayout. When I tried finding them, it field and returned null (and then nullPointerException and then crash/!!)
This is activity_play_game.xml:
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.sortthegraph.PlayGameActivity"
tools:ignore="MergeRootFrame" >
<LinearLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<com.example.sortthegraph.Game_4 // A custom View extends LinearLayout
android:id="#+id/game4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center" >
</com.example.sortthegraph.Game_4>
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="#000000" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
This is my OnCreate function:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_play_game);
tempGame = (Game_4) findViewById(R.id.game4); // ?? Why null ??
This is Game_4 constructors:
public class Game_4 extends LinearLayout {
public Game_4(Context context, AttributeSet attrs) {
this(context);
}
public Game_4(Context context) {
super(context);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.game_4_layout, this, true);
this.setWillNotDraw(false);
}
The game_4_layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="20dp"
android:paddingBottom="25dp"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:gravity="center" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1" />
<com.example.sortthegraph.BackButton
android:id="#+id/backButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp" >
</com.example.sortthegraph.BackButton>
<View android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="20dip"
android:layout_marginTop="20dip" >
<com.example.sortthegraph.BackButton
android:id="#+id/backButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</com.example.sortthegraph.BackButton>
<View
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1" />
<com.example.sortthegraph.BackButton
android:id="#+id/backButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</com.example.sortthegraph.BackButton>
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1" />
<com.example.sortthegraph.BackButton
android:id="#+id/backButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp" >
</com.example.sortthegraph.BackButton>
<View android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1" />
</TableRow>
public Game_4(Context context, AttributeSet attrs) {
this(context);
}
You need to pass the attrs to the super constructor, e.g.
super(context, attrs);
Otherwise the attributes consumed by the superclass such as android:id are lost.
You can do your custom init in this two-arg constructor and call it from the 1-arg constructor as well:
public Game_4(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.game_4_layout, this, true);
this.setWillNotDraw(false);
}
public Game_4(Context context) {
this(context, null);
}
Game_4 has not been imported properly. Also in layout , press CTRL and take the cursor to com.example.sortthegraph.Game_4 and click to go to the corresponding class. If it does not direct to that corresponding class, then there may be some issue.
I'm using ExpandableHeightGridView but I don't manage to calculate the correct height of the gridview, I use custom rows made by an external layout, but it cuts several rows at the bottom,
here's the code:
public class ExpandableHeightGridView extends GridView {
boolean expanded = false;
public ExpandableHeightGridView(Context context) {
super(context);
}
public ExpandableHeightGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ExpandableHeightGridView(Context context, AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
}
public boolean isExpanded() {
return expanded;
}
#Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (isExpanded()) {
int expandSpec = MeasureSpec.makeMeasureSpec(MEASURED_SIZE_MASK,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
ViewGroup.LayoutParams params = getLayoutParams();
params.height = getMeasuredHeight();
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
public void setExpanded(boolean expanded) {
this.expanded = expanded;
}
}
Custom Row
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#null"
android:orientation="vertical" >
<TextView
android:id="#+id/textViewBioAnno"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center_horizontal"
android:text="TextView"
android:textColor="#color/oro"
android:textSize="20sp" />
<TextView
android:id="#+id/textViewBioTesto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="TextView"
android:textSize="15sp" />
</LinearLayout>
My Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/sfondo"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:scaleType="fitCenter"/>
<ImageButton
android:id="#+id/imageView1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_margin="12dp"
android:background="#null"
android:scaleType="fitXY" />
</RelativeLayout>
<TextView
android:id="#+id/textViewBio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="#string/bio"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/oro" />
<******.ExpandableHeightGridView
android:id="#+id/mebersListGridView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:horizontalSpacing="10dp"
android:isScrollContainer="false"
android:numColumns="1"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:src="#drawable/fondo_pagina" />
<ImageView
android:id="#+id/ImageView02"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:layout_marginRight="70dp"/>
<ImageView
android:id="#+id/ImageView01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="100dp"
android:layout_marginRight="100dp"" />
</LinearLayout>
</ScrollView>
</LinearLayout>
My activity:
...
g = (ExpandableHeightGridView) findViewById(R.id.mebersListGridView);
arrayAdapter = new StandardArrayAdapter(this,
R.layout.activity_bio, arrayList);
g.setExpanded(true);
g.setAdapter(arrayAdapter);
...