Why does my button not showing in the layout?
I've been making a tabbed activity with a list view in it. I've been trying to put a button under the list view, but when i run on my phone, the button doesn't show up.
My Fragment layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
My layout preview in my android studio
The layout when i run it on my phone (I'm using an Asus Zenfone 5)
I'm not sure where i did wrong, i actually have change the button into the floating button, but only half of the button shows in the layout. (Plus i can't scroll the layout)
Update
I have resolved it, the problem is in the tabbed activity layout.
I use a constraint layout as the parent, i've changed it to Relative layout and it works perfectly
android android-layout
add a comment |
I've been making a tabbed activity with a list view in it. I've been trying to put a button under the list view, but when i run on my phone, the button doesn't show up.
My Fragment layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
My layout preview in my android studio
The layout when i run it on my phone (I'm using an Asus Zenfone 5)
I'm not sure where i did wrong, i actually have change the button into the floating button, but only half of the button shows in the layout. (Plus i can't scroll the layout)
Update
I have resolved it, the problem is in the tabbed activity layout.
I use a constraint layout as the parent, i've changed it to Relative layout and it works perfectly
android android-layout
add a comment |
I've been making a tabbed activity with a list view in it. I've been trying to put a button under the list view, but when i run on my phone, the button doesn't show up.
My Fragment layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
My layout preview in my android studio
The layout when i run it on my phone (I'm using an Asus Zenfone 5)
I'm not sure where i did wrong, i actually have change the button into the floating button, but only half of the button shows in the layout. (Plus i can't scroll the layout)
Update
I have resolved it, the problem is in the tabbed activity layout.
I use a constraint layout as the parent, i've changed it to Relative layout and it works perfectly
android android-layout
I've been making a tabbed activity with a list view in it. I've been trying to put a button under the list view, but when i run on my phone, the button doesn't show up.
My Fragment layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
My layout preview in my android studio
The layout when i run it on my phone (I'm using an Asus Zenfone 5)
I'm not sure where i did wrong, i actually have change the button into the floating button, but only half of the button shows in the layout. (Plus i can't scroll the layout)
Update
I have resolved it, the problem is in the tabbed activity layout.
I use a constraint layout as the parent, i've changed it to Relative layout and it works perfectly
android android-layout
android android-layout
edited Nov 23 at 7:23
asked Nov 23 at 6:29
llehcram
256
256
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
Try this
change color according to you!
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff"
android:layout_marginRight="7dp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorPrimary"
android:text="helo"
android:textAllCaps="false"
android:textColor="#fff"
android:layout_alignParentLeft="true" />
</RelativeLayout>
</FrameLayout>
unfortunately i doesn't work as well
– llehcram
Nov 23 at 7:14
add a comment |
Try this code..
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_above="@+id/btn_register" />
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorAccent"
android:text="submit"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</RelativeLayout>
Still has the same output unfortunately
– llehcram
Nov 23 at 6:36
it is runtime issue.
– Android Team
Nov 23 at 6:40
pass this line into listview android:layout_above="@+id/btn_register"
– Android Team
Nov 23 at 6:42
i update listview xml code and add above comment line code
– Android Team
Nov 23 at 6:44
still doesn't work as well, maybe you may need my tabbed activity layout?
– llehcram
Nov 23 at 6:54
|
show 2 more comments
Try with this code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Items Detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_register"
android:layout_below="@+id/rl_total_data"/>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/colorAccent"
android:text="Register"
android:textAllCaps="false"
android:textColor="#fff" />
still has the same output
– llehcram
Nov 23 at 7:14
can you show your activity layout. Because just this fragment layout is working fine in device for me
– Vivek Mishra
Nov 23 at 7:25
i have resolved it, turns out my activity layout used coordinator layout instead of relative layout. i have changed it and i works fine now. thank you for your answer!
– llehcram
Nov 23 at 7:30
add a comment |
Try this
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</LinearLayout>
i have resolved it, the problem is in my tabbed activity layout. you should see my update message above. thanks for your answer!
– llehcram
Nov 23 at 7:24
@llehcram I was also curious about the activity layout but i'm late. thanks for your inform about update.
– Mia
Nov 23 at 8:18
add a comment |
This is because of the "match parent" attribute that is in a view above your button.Your button therefore is not shown because a view on top of it has been set to occupy all the space of the parent.
SEE BELOW CODE modification
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
You could try to use weightSum as explained in this post.What is android:weightSum in android, and how does it work?
It give much more control in division of your parent layout
still has the same output
– llehcram
Nov 23 at 7:14
see amended code, the list view also should not match parent
– Mushirih
Nov 23 at 7:29
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%2f53441599%2fwhy-does-my-button-not-showing-in-the-layout%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this
change color according to you!
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff"
android:layout_marginRight="7dp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorPrimary"
android:text="helo"
android:textAllCaps="false"
android:textColor="#fff"
android:layout_alignParentLeft="true" />
</RelativeLayout>
</FrameLayout>
unfortunately i doesn't work as well
– llehcram
Nov 23 at 7:14
add a comment |
Try this
change color according to you!
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff"
android:layout_marginRight="7dp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorPrimary"
android:text="helo"
android:textAllCaps="false"
android:textColor="#fff"
android:layout_alignParentLeft="true" />
</RelativeLayout>
</FrameLayout>
unfortunately i doesn't work as well
– llehcram
Nov 23 at 7:14
add a comment |
Try this
change color according to you!
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff"
android:layout_marginRight="7dp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorPrimary"
android:text="helo"
android:textAllCaps="false"
android:textColor="#fff"
android:layout_alignParentLeft="true" />
</RelativeLayout>
</FrameLayout>
Try this
change color according to you!
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff"
android:layout_marginRight="7dp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorPrimary"
android:text="helo"
android:textAllCaps="false"
android:textColor="#fff"
android:layout_alignParentLeft="true" />
</RelativeLayout>
</FrameLayout>
answered Nov 23 at 6:41
kanhaiyalal sonar
113
113
unfortunately i doesn't work as well
– llehcram
Nov 23 at 7:14
add a comment |
unfortunately i doesn't work as well
– llehcram
Nov 23 at 7:14
unfortunately i doesn't work as well
– llehcram
Nov 23 at 7:14
unfortunately i doesn't work as well
– llehcram
Nov 23 at 7:14
add a comment |
Try this code..
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_above="@+id/btn_register" />
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorAccent"
android:text="submit"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</RelativeLayout>
Still has the same output unfortunately
– llehcram
Nov 23 at 6:36
it is runtime issue.
– Android Team
Nov 23 at 6:40
pass this line into listview android:layout_above="@+id/btn_register"
– Android Team
Nov 23 at 6:42
i update listview xml code and add above comment line code
– Android Team
Nov 23 at 6:44
still doesn't work as well, maybe you may need my tabbed activity layout?
– llehcram
Nov 23 at 6:54
|
show 2 more comments
Try this code..
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_above="@+id/btn_register" />
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorAccent"
android:text="submit"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</RelativeLayout>
Still has the same output unfortunately
– llehcram
Nov 23 at 6:36
it is runtime issue.
– Android Team
Nov 23 at 6:40
pass this line into listview android:layout_above="@+id/btn_register"
– Android Team
Nov 23 at 6:42
i update listview xml code and add above comment line code
– Android Team
Nov 23 at 6:44
still doesn't work as well, maybe you may need my tabbed activity layout?
– llehcram
Nov 23 at 6:54
|
show 2 more comments
Try this code..
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_above="@+id/btn_register" />
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorAccent"
android:text="submit"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</RelativeLayout>
Try this code..
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_above="@+id/btn_register" />
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorAccent"
android:text="submit"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</RelativeLayout>
edited Nov 23 at 6:43
answered Nov 23 at 6:34
Android Team
7,46411033
7,46411033
Still has the same output unfortunately
– llehcram
Nov 23 at 6:36
it is runtime issue.
– Android Team
Nov 23 at 6:40
pass this line into listview android:layout_above="@+id/btn_register"
– Android Team
Nov 23 at 6:42
i update listview xml code and add above comment line code
– Android Team
Nov 23 at 6:44
still doesn't work as well, maybe you may need my tabbed activity layout?
– llehcram
Nov 23 at 6:54
|
show 2 more comments
Still has the same output unfortunately
– llehcram
Nov 23 at 6:36
it is runtime issue.
– Android Team
Nov 23 at 6:40
pass this line into listview android:layout_above="@+id/btn_register"
– Android Team
Nov 23 at 6:42
i update listview xml code and add above comment line code
– Android Team
Nov 23 at 6:44
still doesn't work as well, maybe you may need my tabbed activity layout?
– llehcram
Nov 23 at 6:54
Still has the same output unfortunately
– llehcram
Nov 23 at 6:36
Still has the same output unfortunately
– llehcram
Nov 23 at 6:36
it is runtime issue.
– Android Team
Nov 23 at 6:40
it is runtime issue.
– Android Team
Nov 23 at 6:40
pass this line into listview android:layout_above="@+id/btn_register"
– Android Team
Nov 23 at 6:42
pass this line into listview android:layout_above="@+id/btn_register"
– Android Team
Nov 23 at 6:42
i update listview xml code and add above comment line code
– Android Team
Nov 23 at 6:44
i update listview xml code and add above comment line code
– Android Team
Nov 23 at 6:44
still doesn't work as well, maybe you may need my tabbed activity layout?
– llehcram
Nov 23 at 6:54
still doesn't work as well, maybe you may need my tabbed activity layout?
– llehcram
Nov 23 at 6:54
|
show 2 more comments
Try with this code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Items Detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_register"
android:layout_below="@+id/rl_total_data"/>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/colorAccent"
android:text="Register"
android:textAllCaps="false"
android:textColor="#fff" />
still has the same output
– llehcram
Nov 23 at 7:14
can you show your activity layout. Because just this fragment layout is working fine in device for me
– Vivek Mishra
Nov 23 at 7:25
i have resolved it, turns out my activity layout used coordinator layout instead of relative layout. i have changed it and i works fine now. thank you for your answer!
– llehcram
Nov 23 at 7:30
add a comment |
Try with this code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Items Detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_register"
android:layout_below="@+id/rl_total_data"/>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/colorAccent"
android:text="Register"
android:textAllCaps="false"
android:textColor="#fff" />
still has the same output
– llehcram
Nov 23 at 7:14
can you show your activity layout. Because just this fragment layout is working fine in device for me
– Vivek Mishra
Nov 23 at 7:25
i have resolved it, turns out my activity layout used coordinator layout instead of relative layout. i have changed it and i works fine now. thank you for your answer!
– llehcram
Nov 23 at 7:30
add a comment |
Try with this code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Items Detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_register"
android:layout_below="@+id/rl_total_data"/>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/colorAccent"
android:text="Register"
android:textAllCaps="false"
android:textColor="#fff" />
Try with this code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Items Detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_register"
android:layout_below="@+id/rl_total_data"/>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/colorAccent"
android:text="Register"
android:textAllCaps="false"
android:textColor="#fff" />
answered Nov 23 at 6:40
Vivek Mishra
3,76642955
3,76642955
still has the same output
– llehcram
Nov 23 at 7:14
can you show your activity layout. Because just this fragment layout is working fine in device for me
– Vivek Mishra
Nov 23 at 7:25
i have resolved it, turns out my activity layout used coordinator layout instead of relative layout. i have changed it and i works fine now. thank you for your answer!
– llehcram
Nov 23 at 7:30
add a comment |
still has the same output
– llehcram
Nov 23 at 7:14
can you show your activity layout. Because just this fragment layout is working fine in device for me
– Vivek Mishra
Nov 23 at 7:25
i have resolved it, turns out my activity layout used coordinator layout instead of relative layout. i have changed it and i works fine now. thank you for your answer!
– llehcram
Nov 23 at 7:30
still has the same output
– llehcram
Nov 23 at 7:14
still has the same output
– llehcram
Nov 23 at 7:14
can you show your activity layout. Because just this fragment layout is working fine in device for me
– Vivek Mishra
Nov 23 at 7:25
can you show your activity layout. Because just this fragment layout is working fine in device for me
– Vivek Mishra
Nov 23 at 7:25
i have resolved it, turns out my activity layout used coordinator layout instead of relative layout. i have changed it and i works fine now. thank you for your answer!
– llehcram
Nov 23 at 7:30
i have resolved it, turns out my activity layout used coordinator layout instead of relative layout. i have changed it and i works fine now. thank you for your answer!
– llehcram
Nov 23 at 7:30
add a comment |
Try this
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</LinearLayout>
i have resolved it, the problem is in my tabbed activity layout. you should see my update message above. thanks for your answer!
– llehcram
Nov 23 at 7:24
@llehcram I was also curious about the activity layout but i'm late. thanks for your inform about update.
– Mia
Nov 23 at 8:18
add a comment |
Try this
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</LinearLayout>
i have resolved it, the problem is in my tabbed activity layout. you should see my update message above. thanks for your answer!
– llehcram
Nov 23 at 7:24
@llehcram I was also curious about the activity layout but i'm late. thanks for your inform about update.
– Mia
Nov 23 at 8:18
add a comment |
Try this
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</LinearLayout>
Try this
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</LinearLayout>
answered Nov 23 at 7:21
Mia
11
11
i have resolved it, the problem is in my tabbed activity layout. you should see my update message above. thanks for your answer!
– llehcram
Nov 23 at 7:24
@llehcram I was also curious about the activity layout but i'm late. thanks for your inform about update.
– Mia
Nov 23 at 8:18
add a comment |
i have resolved it, the problem is in my tabbed activity layout. you should see my update message above. thanks for your answer!
– llehcram
Nov 23 at 7:24
@llehcram I was also curious about the activity layout but i'm late. thanks for your inform about update.
– Mia
Nov 23 at 8:18
i have resolved it, the problem is in my tabbed activity layout. you should see my update message above. thanks for your answer!
– llehcram
Nov 23 at 7:24
i have resolved it, the problem is in my tabbed activity layout. you should see my update message above. thanks for your answer!
– llehcram
Nov 23 at 7:24
@llehcram I was also curious about the activity layout but i'm late. thanks for your inform about update.
– Mia
Nov 23 at 8:18
@llehcram I was also curious about the activity layout but i'm late. thanks for your inform about update.
– Mia
Nov 23 at 8:18
add a comment |
This is because of the "match parent" attribute that is in a view above your button.Your button therefore is not shown because a view on top of it has been set to occupy all the space of the parent.
SEE BELOW CODE modification
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
You could try to use weightSum as explained in this post.What is android:weightSum in android, and how does it work?
It give much more control in division of your parent layout
still has the same output
– llehcram
Nov 23 at 7:14
see amended code, the list view also should not match parent
– Mushirih
Nov 23 at 7:29
add a comment |
This is because of the "match parent" attribute that is in a view above your button.Your button therefore is not shown because a view on top of it has been set to occupy all the space of the parent.
SEE BELOW CODE modification
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
You could try to use weightSum as explained in this post.What is android:weightSum in android, and how does it work?
It give much more control in division of your parent layout
still has the same output
– llehcram
Nov 23 at 7:14
see amended code, the list view also should not match parent
– Mushirih
Nov 23 at 7:29
add a comment |
This is because of the "match parent" attribute that is in a view above your button.Your button therefore is not shown because a view on top of it has been set to occupy all the space of the parent.
SEE BELOW CODE modification
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
You could try to use weightSum as explained in this post.What is android:weightSum in android, and how does it work?
It give much more control in division of your parent layout
This is because of the "match parent" attribute that is in a view above your button.Your button therefore is not shown because a view on top of it has been set to occupy all the space of the parent.
SEE BELOW CODE modification
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
You could try to use weightSum as explained in this post.What is android:weightSum in android, and how does it work?
It give much more control in division of your parent layout
edited Nov 23 at 7:29
answered Nov 23 at 6:37
Mushirih
331313
331313
still has the same output
– llehcram
Nov 23 at 7:14
see amended code, the list view also should not match parent
– Mushirih
Nov 23 at 7:29
add a comment |
still has the same output
– llehcram
Nov 23 at 7:14
see amended code, the list view also should not match parent
– Mushirih
Nov 23 at 7:29
still has the same output
– llehcram
Nov 23 at 7:14
still has the same output
– llehcram
Nov 23 at 7:14
see amended code, the list view also should not match parent
– Mushirih
Nov 23 at 7:29
see amended code, the list view also should not match parent
– Mushirih
Nov 23 at 7:29
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53441599%2fwhy-does-my-button-not-showing-in-the-layout%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