parallaxscroll view in android is not working - android

Hi I am trying to achieve parallaxscrollview in my application using library from link below:-
https://github.com/nirhart/ParallaxScroll
And below is the my xml code:-
<com.nirhart.parallaxscroll.views.ParallaxScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:inner_parallax_factor="1.9"
app:parallax_factor="1.9"
app:parallax_views_num="3"
android:background="#drawable/bg_profile_summary" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="#+id/LIN_First"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false"
android:weightSum="2" >
<RelativeLayout
android:id="#+id/REL_People"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_weight="1"
android:background="#drawable/bg_profile_list_item"
android:padding="10dp" >
<TextView
android:id="#+id/TXT_Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:textStyle="bold"
android:text="#string/str_txt_people"
android:textColor="#FFFFFF" />
<ImageView
android:id="#+id/IMG_Right_Arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="right"
android:contentDescription="#string/app_name"
android:src="#drawable/ic_nav_right_white" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/REL_Popular"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_weight="1"
android:background="#drawable/bg_profile_list_item"
android:padding="10dp" >
<TextView
android:id="#+id/TXT_TitlePopular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:textStyle="bold"
android:text="#string/str_txt_popular"
android:textColor="#FFFFFF" />
<ImageView
android:id="#+id/IMG_Right_Arrow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="right"
android:contentDescription="#string/app_name"
android:src="#drawable/ic_nav_right_white" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/REL_Official_Act"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="#+id/LIN_First"
android:background="#drawable/bg_profile_list_item"
android:padding="10dp" >
<TextView
android:id="#+id/TXT_OfficialAccounts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:textStyle="bold"
android:text="#string/str_official_accounts"
android:textColor="#FFFFFF" />
<ImageView
android:id="#+id/IMG_Right_Arrow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="right"
android:contentDescription="#string/app_name"
android:src="#drawable/ic_nav_right_white" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/REL_Search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/REL_Official_Act"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<EditText
android:id="#+id/EDT_Search_text"
android:layout_width="250dp"
android:layout_height="35dp"
android:background="#drawable/ic_search_text_background"
android:hint="#string/str_edt_searchanything_hint"
android:paddingBottom="2dp"
android:paddingLeft="15dp"
android:paddingTop="2dp" />
<RelativeLayout
android:id="#+id/REL_SearchButton"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/EDT_Search_text"
android:background="#drawable/ic_search_btn_bg"
android:gravity="center" >
<Button
android:id="#+id/BTN_Search"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:background="#drawable/ic_search"
android:padding="5dp" />
</RelativeLayout>
</RelativeLayout>
<ListView
android:id="#+id/LST_AlbumList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_alignParentBottom="true"
android:layout_below="#+id/REL_Search"
android:dividerHeight="0dip" >
</ListView>
</RelativeLayout>
</com.nirhart.parallaxscroll.views.ParallaxScrollView>
I am trying to achieve MultipleParallaxScrollView.
But nothing is happening.
Will anybody please explain me what to do??
Thanks in advance.

You need to use LinearLayout as a child in ParallaxScrollView.
You should place one child in ParallaxScrollView containing the entire contents to scroll; which is a LinearLayout

this problem is occurred because dependency use implementation 'com.github.nirhart:parallaxscroll:1.0' not working with compileSdkVersion 27 or new sdk version,
you can salve this to download module from github and impot module in your project and update with ur project sdk version.this is my project update library gradle sdk version

Related

Error inflating class android widget checkbox

This is my xml infected code..
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="#331c57"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="#drawable/gappshapp" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="50dp"
android:layout_height="60dp"
android:layout_alignParentRight="true"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="#drawable/threedots" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="35dp"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Activation"
android:textColor="#android:color/background_dark"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="25dp"
android:background="#331c57"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center"
android:text="An Activation Code was Sent to your Mobile Device, Enter the code below"
android:textColor="#android:color/background_light"
android:textSize="15sp" />
</LinearLayout>
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="250210"
android:textColor="#android:color/background_dark" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="25dp"
android:orientation="horizontal" >
<CheckBox
android:id="#+id/chkIos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I agree with the Terms and Conditions" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/continuebtn" />
</LinearLayout>
</LinearLayout>
it crashes when i changes my theme
i also uses the appcompat-v7 as a library and android support v7 appcompat and android support v4 jar as library but still it crash
this is my xml code,there is not code in activity,i just working on xml file and and it crashes at checkbox
during inflating class android widget checkbox...
i don't know whats happening here, i need solution for it.
I had the same problem today.
If I use the following:
import android.support.v7.app.AppCompatActivity;
and try and use import android.widget.CheckBox;
with a standard checkbox:
private CheckBox mSendSMSNotification;it also fails with the same error.
Converting to:
import android.support.v7.widget.AppCompatCheckBox;
private AppCompatCheckBox mSendSMSNotification;
and also in XML:
<android.support.v7.widget.AppCompatCheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Send SMS Notification when Reports Emailed"
android:id="#+id/checkBoxSendSMSNotification"
android:layout_row="3"
android:layout_column="0"
android:layout_columnSpan="2" />
resolves the error, but I dont know why.
My min API 16, target API 23

How to make header with scrollview

I want to make a header in my layout just like below image:-
enter image description here
here my code:-
<RelativeLayout
android:id="#+id/header_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:text="#string/filter"
android:drawableLeft="#drawable/filter1"
android:textSize="16dp"
android:id="#+id/textView"
android:background="#android:color/white"
android:textColor="#000"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/sort"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:id="#+id/textview_sort"
android:textSize="16sp"
android:drawableLeft="#drawable/sort1"
android:background="#android:color/white"
android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/textView"
android:drawableLeft="#drawable/view1"
android:text="#string/view"
android:textSize="16sp"
android:background="#android:color/white"
android:id="#+id/change_view"
android:textColor="#000"/>
</LinearLayout>
</RelativeLayout>
Any one can help me how solve my problem. I am new in android developing please help me.Thanks in advance
It Could be achieved by two manner.
1) Custom Header
2) Actionbar/Toolbar.
Custom header means only height attribute you have to take as#dimen/abs__action_bar_default_height(if you are using appcompat).
For eg. sample demo
`
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/abc_action_bar_default_height_material"
android:background="#FF6600"
>
<ImageView
android:id="#+id/menu"
android:layout_width="50dp"
android:layout_height="100dp"
android:src="#drawable/abc_ic_menu_moreoverflow_mtrl_alpha"
android:layout_centerVertical="true"
/>
<Spinner
android:id="#+id/spinner"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/menu"
android:entries="#array/array_name"
>
</Spinner>
<ImageView
android:id="#+id/search"
android:layout_width="50dp"
android:layout_height="100dp"
android:src="#drawable/abc_ic_search_api_mtrl_alpha"
android:layout_toRightOf="#+id/spinner"
android:layout_centerVertical="true"
/>
<ImageView
android:id="#+id/star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/star_yellow"
android:layout_toRightOf="#+id/search"
android:layout_marginLeft="5dp"
android:layout_centerVertical="true"
/>
<ImageView
android:id="#+id/shop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/abc_ic_menu_copy_mtrl_am_alpha"
android:layout_toRightOf="#+id/star"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
/>
</RelativeLayout>
</LinearLayout>
`
Just give it a try.

Fetch imageview to all the screen in relativelayout between buttons and edittext

I have the below XML relativelayout... I need help to make the image always fetch to all the screen but between above name ju and below buttons.
the following ImageView parameter make the image centered.
<?xml version="1.0" encoding="utf-8"?>
< RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView android:id="#+id/nameview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFFE0"
android:paddingBottom="10dp"
android:paddingTop="14dp"
android:paddingLeft="45dp"
android:fontFamily="Arial"
android:textSize="18sp"
android:textStyle="bold"
android:text="Ju" />
<ImageView android:id="#+id/SingleView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/nameview"/>
<Button
android:id="#+id/funnyBtn"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginTop="10dp"
android:layout_below="#+id/SingleView"
android:layout_alignParentLeft="true"
android:src="#drawable/smileclk"
android:background="#drawable/smileclk"
android:layout_marginLeft="25dp"
android:text="" />
<Button
android:id="#+id/test1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/SingleView"
android:layout_toRightOf="#+id/funnyBtn"
android:layout_marginLeft="15dp"
android:text="test1" />
<Button
android:id="#+id/test2Btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/SingleView"
android:layout_toRightOf="#+id/comment"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:text="test2" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="20dp"
android:layout_below="#+id/test2Btn"
android:background="#ff00ff00" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="20dp"
android:padding="10dip" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Calculation" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#ffffff" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
this is my result for now
this is my desire output
As murtaza mentioned adding android:scaleType="fitXY" helped
<ImageView android:id="#+id/SingleView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:layout_below="#id/nameview"/>

Android - "Exception raised during rendering: Could not initialize class libcore.util.ZoneInfoDB" on preview and design view

I get this render problem when trying to view the preview or design view in some of my my xml layouts:
Exception raised during rendering: Could not initialize class libcore.util.ZoneInfoDB
Here is one of my layouts with the problem:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/rlMeasures"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp" >
<TextView
android:id="#+id/tvBat"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/percentage"
android:textSize="20sp" />
<TextView
android:id="#+id/tvAlarm"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/tvBat"
android:layout_toRightOf="#id/tvBat"
android:layout_toEndOf="#id/tvBat"
android:gravity="end"
android:text="#string/blank"
android:textSize="20sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/rlMeasures"
android:layout_centerHorizontal="true" >
<TextView
android:id="#+id/tvTime"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/time"
android:textSize="80sp" />
<TextView
android:id="#+id/tvDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tvTime"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="#string/date"
android:textSize="20sp" />
<TextView
android:id="#+id/tvAmPm"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/tvTime"
android:layout_marginBottom="15dp"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_toRightOf="#id/tvTime"
android:layout_toEndOf="#id/tvTime"
android:gravity="center"
android:text="#string/ampm"
android:textSize="20sp" />
</RelativeLayout>
<AnalogClock
android:id="#+id/ac"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/rlTime"
android:layout_below="#+id/adView"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:dial="#drawable/acnbface"
android:hand_hour="#drawable/achour"
android:hand_minute="#drawable/acminute" />
<com.google.android.gms.ads.AdView
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-6205053969368684/3258044850"
android:gravity="center" >
</com.google.android.gms.ads.AdView>
<RelativeLayout
android:id="#+id/rlActivity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:background="#drawable/gradientright"
android:gravity="center_vertical|start" >
<ScrollView
android:id="#+id/svActivity"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
tools:ignore="UselessParent" >
<RelativeLayout
android:id="#+id/rlActivity2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" >
<ImageButton
android:id="#+id/ibStopwatch"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="10dp"
android:background="#drawable/stopwatch"
android:contentDescription="#string/stopwatch" />
<ImageButton
android:id="#+id/ibFs"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_below="#id/ibStopwatch"
android:layout_margin="10dp"
android:background="#drawable/fs"
android:contentDescription="#string/fs" />
<ImageButton
android:id="#+id/ibFsn"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_below="#id/ibFs"
android:layout_margin="10dp"
android:background="#drawable/fsnm"
android:contentDescription="#string/fsn" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlShort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_gravity="center_vertical"
android:background="#drawable/gradientleft"
android:gravity="center_vertical|end" >
<ScrollView
android:id="#+id/svShort"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
tools:ignore="UselessParent" >
<RelativeLayout
android:id="#+id/rlShort2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" >
<ImageButton
android:id="#+id/ibMusic"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_margin="5dp"
android:background="#drawable/music"
android:contentDescription="#string/music" />
<ImageButton
android:id="#+id/ibYoutube"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="#id/ibMusic"
android:layout_margin="5dp"
android:background="#drawable/youtube"
android:contentDescription="#string/youtube" />
<ImageButton
android:id="#+id/ibKeep"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="#id/ibYoutube"
android:layout_margin="5dp"
android:background="#drawable/keep"
android:contentDescription="#string/keep" />
<ImageButton
android:id="#+id/ibPlay"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="#id/ibKeep"
android:layout_margin="5dp"
android:background="#drawable/play"
android:contentDescription="#string/play" />
<ImageButton
android:id="#+id/ibSearch"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="#id/ibPlay"
android:layout_margin="5dp"
android:background="#drawable/search"
android:contentDescription="#string/search" />
<ImageButton
android:id="#+id/ibBrowser"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="#id/ibSearch"
android:layout_margin="5dp"
android:background="#drawable/browser"
android:contentDescription="#string/browser" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</RelativeLayout>
I am getting no errors or warnings from Android Studio and i can debug the application without any issues. Can anyone explain to me the situation? is it something in my code or an Android Studio Bug?
Thanks
This error occurs with the AnalogClock under Android 21. You can try switching (temporarily) to Android L or lower while you work on your layout.
A report was filed for this issue at http://b.android.com/79160

How to position a TextView inside a RelativeLayout from another RelativeLayout?

I am having this problem where I need to place TextView(green) inside RelativeLayout(blue) below RelativeLayout(black) but ImageView(orange) stays overlapping
Here's the legend:
RelativeLayout(black) id/image_view_container
ImageView(brown)
RelativeLayout(blue)
ImageView(orange) id/profileImage
TextView(green)
I tried:
android:layout_toRightOf="#id/profileImage"
android:layout_below="#id/image_view_container"
but it's not working, probably because image_view_container is from another RelativeLayout.
I need assistance in this, thanks ahead!
Edit:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/image_view_container" >
<ImageView
android:id="#+id/mainImage"
android:layout_width="fill_parent"
android:layout_height="210dp"
android:background="#ffffff"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-30dp"
android:gravity="bottom"
android:orientation="horizontal" >
<ImageView
android:id="#+id/profileImage"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_weight="0"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
/>
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_below="#id/image_view_container"
android:layout_toRightOf="#id/profileImage"
android:layout_weight="1"
android:text="6363"
android:textColor="#color/A"
android:textSize="20sp"
android:textStyle="bold"
android:translationY="5dp" />
</RelativeLayout>
Try the following in your image_view_container
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
Try this
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/image_view_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ff00ff" >
<ImageView
android:id="#+id/mainImage"
android:layout_width="fill_parent"
android:layout_height="310dp"
android:layout_margin="20dp"
android:background="#ffff00" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/image_view_container"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<ImageView
android:id="#+id/profileImage"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="20dp"
android:layout_weight="0"
android:background="#ff1234"
android:scaleType="centerCrop" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_below="#id/profileImage"
android:layout_toRightOf="#id/profileImage"
android:layout_weight="1"
android:text="6363"
android:background="#ff0034"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>

Categories

Resources