How to keep one layout over another layout in android
This is my xml I want to keep one layout over another layout.
I have progress Bar and try again Textview in same place I am doing visible and invisible Textview and Progressbar programatically, so I want keep Progressbar over try again button, but I am unable to do this.
I have searched from google that we can do using Frame layout but its not working.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</FrameLayout>
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
</LinearLayout>
android android-layout
add a comment |
This is my xml I want to keep one layout over another layout.
I have progress Bar and try again Textview in same place I am doing visible and invisible Textview and Progressbar programatically, so I want keep Progressbar over try again button, but I am unable to do this.
I have searched from google that we can do using Frame layout but its not working.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</FrameLayout>
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
</LinearLayout>
android android-layout
3
useFrameLayout
its there for a reason.
– Karan Mer
Nov 15 '18 at 6:30
1
You need to explain what "its not working" means: stackoverflow.com/help/how-to-ask
– dominicoder
Nov 15 '18 at 6:31
@KaranMer is right. You can also useRelative Layout
if you just want to play withProgressBar
– Ali Ahmed
Nov 15 '18 at 6:32
add a comment |
This is my xml I want to keep one layout over another layout.
I have progress Bar and try again Textview in same place I am doing visible and invisible Textview and Progressbar programatically, so I want keep Progressbar over try again button, but I am unable to do this.
I have searched from google that we can do using Frame layout but its not working.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</FrameLayout>
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
</LinearLayout>
android android-layout
This is my xml I want to keep one layout over another layout.
I have progress Bar and try again Textview in same place I am doing visible and invisible Textview and Progressbar programatically, so I want keep Progressbar over try again button, but I am unable to do this.
I have searched from google that we can do using Frame layout but its not working.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</FrameLayout>
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
</LinearLayout>
android android-layout
android android-layout
edited Nov 22 '18 at 17:12
James Z
11.2k71935
11.2k71935
asked Nov 15 '18 at 6:29
Bhaskar MartBhaskar Mart
126
126
3
useFrameLayout
its there for a reason.
– Karan Mer
Nov 15 '18 at 6:30
1
You need to explain what "its not working" means: stackoverflow.com/help/how-to-ask
– dominicoder
Nov 15 '18 at 6:31
@KaranMer is right. You can also useRelative Layout
if you just want to play withProgressBar
– Ali Ahmed
Nov 15 '18 at 6:32
add a comment |
3
useFrameLayout
its there for a reason.
– Karan Mer
Nov 15 '18 at 6:30
1
You need to explain what "its not working" means: stackoverflow.com/help/how-to-ask
– dominicoder
Nov 15 '18 at 6:31
@KaranMer is right. You can also useRelative Layout
if you just want to play withProgressBar
– Ali Ahmed
Nov 15 '18 at 6:32
3
3
use
FrameLayout
its there for a reason.– Karan Mer
Nov 15 '18 at 6:30
use
FrameLayout
its there for a reason.– Karan Mer
Nov 15 '18 at 6:30
1
1
You need to explain what "its not working" means: stackoverflow.com/help/how-to-ask
– dominicoder
Nov 15 '18 at 6:31
You need to explain what "its not working" means: stackoverflow.com/help/how-to-ask
– dominicoder
Nov 15 '18 at 6:31
@KaranMer is right. You can also use
Relative Layout
if you just want to play with ProgressBar
– Ali Ahmed
Nov 15 '18 at 6:32
@KaranMer is right. You can also use
Relative Layout
if you just want to play with ProgressBar
– Ali Ahmed
Nov 15 '18 at 6:32
add a comment |
3 Answers
3
active
oldest
votes
Update your Layout as below - Relative Layout
can do the trick
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_centerInParent="true"
android:visibility="visible"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</RelativeLayout>
</LinearLayout>
its not working every thing is coming left side
– Bhaskar Mart
Nov 15 '18 at 6:44
updated code, Try now
– Ali Ahmed
Nov 15 '18 at 6:46
add a comment |
You can simply use constraint layout in your case as basically its
from the family of frame layout , you can implement the code below.just take your root layout as ConstraintLayout
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/try_again"
app:layout_constraintBottom_toBottomOf="@id/try_again"
app:layout_constraintLeft_toLeftOf="@id/try_again"
app:layout_constraintRight_toRightOf="@id/try_again"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
add a comment |
You have to move your try_again
TextView to inside of FrameLayout so the your Progressbar will show on TextView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:orientation="vertical"
android:paddingLeft="@dimen/margin_18"
android:paddingTop="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:paddingBottom="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_12"
android:gravity="center"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminateDrawable="@drawable/custom_progress_bar"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:visibility="visible" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
</FrameLayout>
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
Here it is the image what you want.
Sorry </LinearLayout> closing tag is missing in the end of the layout.
– scienticious
Nov 15 '18 at 7:12
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313644%2fhow-to-keep-one-layout-over-another-layout-in-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Update your Layout as below - Relative Layout
can do the trick
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_centerInParent="true"
android:visibility="visible"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</RelativeLayout>
</LinearLayout>
its not working every thing is coming left side
– Bhaskar Mart
Nov 15 '18 at 6:44
updated code, Try now
– Ali Ahmed
Nov 15 '18 at 6:46
add a comment |
Update your Layout as below - Relative Layout
can do the trick
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_centerInParent="true"
android:visibility="visible"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</RelativeLayout>
</LinearLayout>
its not working every thing is coming left side
– Bhaskar Mart
Nov 15 '18 at 6:44
updated code, Try now
– Ali Ahmed
Nov 15 '18 at 6:46
add a comment |
Update your Layout as below - Relative Layout
can do the trick
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_centerInParent="true"
android:visibility="visible"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</RelativeLayout>
</LinearLayout>
Update your Layout as below - Relative Layout
can do the trick
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:paddingBottom="@dimen/margin_18"
android:paddingLeft="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:orientation="vertical"
android:paddingTop="@dimen/margin_18">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
</LinearLayout>
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_centerInParent="true"
android:visibility="visible"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
</RelativeLayout>
</LinearLayout>
edited Nov 15 '18 at 6:46
answered Nov 15 '18 at 6:40
Ali AhmedAli Ahmed
1,3411314
1,3411314
its not working every thing is coming left side
– Bhaskar Mart
Nov 15 '18 at 6:44
updated code, Try now
– Ali Ahmed
Nov 15 '18 at 6:46
add a comment |
its not working every thing is coming left side
– Bhaskar Mart
Nov 15 '18 at 6:44
updated code, Try now
– Ali Ahmed
Nov 15 '18 at 6:46
its not working every thing is coming left side
– Bhaskar Mart
Nov 15 '18 at 6:44
its not working every thing is coming left side
– Bhaskar Mart
Nov 15 '18 at 6:44
updated code, Try now
– Ali Ahmed
Nov 15 '18 at 6:46
updated code, Try now
– Ali Ahmed
Nov 15 '18 at 6:46
add a comment |
You can simply use constraint layout in your case as basically its
from the family of frame layout , you can implement the code below.just take your root layout as ConstraintLayout
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/try_again"
app:layout_constraintBottom_toBottomOf="@id/try_again"
app:layout_constraintLeft_toLeftOf="@id/try_again"
app:layout_constraintRight_toRightOf="@id/try_again"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
add a comment |
You can simply use constraint layout in your case as basically its
from the family of frame layout , you can implement the code below.just take your root layout as ConstraintLayout
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/try_again"
app:layout_constraintBottom_toBottomOf="@id/try_again"
app:layout_constraintLeft_toLeftOf="@id/try_again"
app:layout_constraintRight_toRightOf="@id/try_again"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
add a comment |
You can simply use constraint layout in your case as basically its
from the family of frame layout , you can implement the code below.just take your root layout as ConstraintLayout
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/try_again"
app:layout_constraintBottom_toBottomOf="@id/try_again"
app:layout_constraintLeft_toLeftOf="@id/try_again"
app:layout_constraintRight_toRightOf="@id/try_again"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
You can simply use constraint layout in your case as basically its
from the family of frame layout , you can implement the code below.just take your root layout as ConstraintLayout
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/try_again"
app:layout_constraintBottom_toBottomOf="@id/try_again"
app:layout_constraintLeft_toLeftOf="@id/try_again"
app:layout_constraintRight_toRightOf="@id/try_again"
android:visibility="visible"
android:paddingLeft="@dimen/cl_48"
android:paddingRight="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingBottom="@dimen/padding_12"
android:indeterminateDrawable="@drawable/custom_progress_bar"/>
answered Nov 15 '18 at 7:05
Sagar BhatnagarSagar Bhatnagar
33318
33318
add a comment |
add a comment |
You have to move your try_again
TextView to inside of FrameLayout so the your Progressbar will show on TextView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:orientation="vertical"
android:paddingLeft="@dimen/margin_18"
android:paddingTop="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:paddingBottom="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_12"
android:gravity="center"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminateDrawable="@drawable/custom_progress_bar"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:visibility="visible" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
</FrameLayout>
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
Here it is the image what you want.
Sorry </LinearLayout> closing tag is missing in the end of the layout.
– scienticious
Nov 15 '18 at 7:12
add a comment |
You have to move your try_again
TextView to inside of FrameLayout so the your Progressbar will show on TextView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:orientation="vertical"
android:paddingLeft="@dimen/margin_18"
android:paddingTop="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:paddingBottom="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_12"
android:gravity="center"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminateDrawable="@drawable/custom_progress_bar"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:visibility="visible" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
</FrameLayout>
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
Here it is the image what you want.
Sorry </LinearLayout> closing tag is missing in the end of the layout.
– scienticious
Nov 15 '18 at 7:12
add a comment |
You have to move your try_again
TextView to inside of FrameLayout so the your Progressbar will show on TextView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:orientation="vertical"
android:paddingLeft="@dimen/margin_18"
android:paddingTop="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:paddingBottom="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_12"
android:gravity="center"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminateDrawable="@drawable/custom_progress_bar"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:visibility="visible" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
</FrameLayout>
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
Here it is the image what you want.
You have to move your try_again
TextView to inside of FrameLayout so the your Progressbar will show on TextView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tesco_blue"
android:orientation="vertical"
android:paddingLeft="@dimen/margin_18"
android:paddingTop="@dimen/margin_18"
android:paddingRight="@dimen/margin_12"
android:paddingBottom="@dimen/margin_18">
<LinearLayout
android:id="@+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/margin_56"
android:layout_marginRight="@dimen/margin_56"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
<TextView
android:id="@+id/errortitle"
style="@style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="@string/pwp_network_error" />
<TextView
android:id="@+id/errordesc"
style="@style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_12"
android:gravity="center"
android:lineSpacingExtra="8sp"
tools:text="@string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
<ProgressBar
android:id="@+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminateDrawable="@drawable/custom_progress_bar"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:visibility="visible" />
<TextView
android:id="@+id/try_again"
style="@style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/error_button_background"
android:gravity="center"
android:paddingLeft="@dimen/cl_48"
android:paddingTop="@dimen/padding_12"
android:paddingRight="@dimen/cl_48"
android:paddingBottom="@dimen/padding_12"
android:text="@string/Tryagain"
android:textColor="@color/fdv_pending_state_color" />
</FrameLayout>
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_40" />
Here it is the image what you want.
answered Nov 15 '18 at 7:06
scienticiousscienticious
314316
314316
Sorry </LinearLayout> closing tag is missing in the end of the layout.
– scienticious
Nov 15 '18 at 7:12
add a comment |
Sorry </LinearLayout> closing tag is missing in the end of the layout.
– scienticious
Nov 15 '18 at 7:12
Sorry </LinearLayout> closing tag is missing in the end of the layout.
– scienticious
Nov 15 '18 at 7:12
Sorry </LinearLayout> closing tag is missing in the end of the layout.
– scienticious
Nov 15 '18 at 7:12
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313644%2fhow-to-keep-one-layout-over-another-layout-in-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
use
FrameLayout
its there for a reason.– Karan Mer
Nov 15 '18 at 6:30
1
You need to explain what "its not working" means: stackoverflow.com/help/how-to-ask
– dominicoder
Nov 15 '18 at 6:31
@KaranMer is right. You can also use
Relative Layout
if you just want to play withProgressBar
– Ali Ahmed
Nov 15 '18 at 6:32