EditText appears in Design but not in the real apk
This is the activity_main.xml
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_toRightOf="@id/label"
android:layout_toEndOf="@id/label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
android:layout_alignBaseline="@id/label"
/>
</RelativeLayout>
In the Design, on Android Studio, both the TextView
and the EditText
can be seen, but after compiling only the TextView
is visible.
Why?
Screenshots
Design:
Apk:
Thanks
Styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
android android-studio android-layout android-edittext
|
show 5 more comments
This is the activity_main.xml
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_toRightOf="@id/label"
android:layout_toEndOf="@id/label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
android:layout_alignBaseline="@id/label"
/>
</RelativeLayout>
In the Design, on Android Studio, both the TextView
and the EditText
can be seen, but after compiling only the TextView
is visible.
Why?
Screenshots
Design:
Apk:
Thanks
Styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
android android-studio android-layout android-edittext
Can you post the Screen Shot also
– Sniffer
Nov 15 '18 at 5:11
Try to change the theme in your Style file. You can share your style file code here so that I can assist you.
– Rahul Sharma
Nov 15 '18 at 5:16
2
Changeandroid:layout_alignBaseline="@id/label"
toandroid:layout_alignBaseline="@+id/label"
,android:layout_toRightOf="@id/label"
toandroid:layout_toRightOf="@+id/label"
,android:layout_toEndOf="@id/label" to
android:layout_toEndOf="@+id/label"
– Piyush
Nov 15 '18 at 5:17
1
Removeandroid:layout_alignBaseline="@id/label"
– Jared Rummler
Nov 15 '18 at 6:09
1
copy pasted your code and run app. it worked like a charm. maybe you have any other problem. try to test it on any other device
– Ali Ahmed
Nov 15 '18 at 6:24
|
show 5 more comments
This is the activity_main.xml
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_toRightOf="@id/label"
android:layout_toEndOf="@id/label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
android:layout_alignBaseline="@id/label"
/>
</RelativeLayout>
In the Design, on Android Studio, both the TextView
and the EditText
can be seen, but after compiling only the TextView
is visible.
Why?
Screenshots
Design:
Apk:
Thanks
Styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
android android-studio android-layout android-edittext
This is the activity_main.xml
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_toRightOf="@id/label"
android:layout_toEndOf="@id/label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
android:layout_alignBaseline="@id/label"
/>
</RelativeLayout>
In the Design, on Android Studio, both the TextView
and the EditText
can be seen, but after compiling only the TextView
is visible.
Why?
Screenshots
Design:
Apk:
Thanks
Styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
android android-studio android-layout android-edittext
android android-studio android-layout android-edittext
edited Nov 15 '18 at 5:53
H. Riantsoa
asked Nov 15 '18 at 5:10
H. RiantsoaH. Riantsoa
326
326
Can you post the Screen Shot also
– Sniffer
Nov 15 '18 at 5:11
Try to change the theme in your Style file. You can share your style file code here so that I can assist you.
– Rahul Sharma
Nov 15 '18 at 5:16
2
Changeandroid:layout_alignBaseline="@id/label"
toandroid:layout_alignBaseline="@+id/label"
,android:layout_toRightOf="@id/label"
toandroid:layout_toRightOf="@+id/label"
,android:layout_toEndOf="@id/label" to
android:layout_toEndOf="@+id/label"
– Piyush
Nov 15 '18 at 5:17
1
Removeandroid:layout_alignBaseline="@id/label"
– Jared Rummler
Nov 15 '18 at 6:09
1
copy pasted your code and run app. it worked like a charm. maybe you have any other problem. try to test it on any other device
– Ali Ahmed
Nov 15 '18 at 6:24
|
show 5 more comments
Can you post the Screen Shot also
– Sniffer
Nov 15 '18 at 5:11
Try to change the theme in your Style file. You can share your style file code here so that I can assist you.
– Rahul Sharma
Nov 15 '18 at 5:16
2
Changeandroid:layout_alignBaseline="@id/label"
toandroid:layout_alignBaseline="@+id/label"
,android:layout_toRightOf="@id/label"
toandroid:layout_toRightOf="@+id/label"
,android:layout_toEndOf="@id/label" to
android:layout_toEndOf="@+id/label"
– Piyush
Nov 15 '18 at 5:17
1
Removeandroid:layout_alignBaseline="@id/label"
– Jared Rummler
Nov 15 '18 at 6:09
1
copy pasted your code and run app. it worked like a charm. maybe you have any other problem. try to test it on any other device
– Ali Ahmed
Nov 15 '18 at 6:24
Can you post the Screen Shot also
– Sniffer
Nov 15 '18 at 5:11
Can you post the Screen Shot also
– Sniffer
Nov 15 '18 at 5:11
Try to change the theme in your Style file. You can share your style file code here so that I can assist you.
– Rahul Sharma
Nov 15 '18 at 5:16
Try to change the theme in your Style file. You can share your style file code here so that I can assist you.
– Rahul Sharma
Nov 15 '18 at 5:16
2
2
Change
android:layout_alignBaseline="@id/label"
to android:layout_alignBaseline="@+id/label"
, android:layout_toRightOf="@id/label"
to android:layout_toRightOf="@+id/label"
, android:layout_toEndOf="@id/label" to
android:layout_toEndOf="@+id/label"
– Piyush
Nov 15 '18 at 5:17
Change
android:layout_alignBaseline="@id/label"
to android:layout_alignBaseline="@+id/label"
, android:layout_toRightOf="@id/label"
to android:layout_toRightOf="@+id/label"
, android:layout_toEndOf="@id/label" to
android:layout_toEndOf="@+id/label"
– Piyush
Nov 15 '18 at 5:17
1
1
Remove
android:layout_alignBaseline="@id/label"
– Jared Rummler
Nov 15 '18 at 6:09
Remove
android:layout_alignBaseline="@id/label"
– Jared Rummler
Nov 15 '18 at 6:09
1
1
copy pasted your code and run app. it worked like a charm. maybe you have any other problem. try to test it on any other device
– Ali Ahmed
Nov 15 '18 at 6:24
copy pasted your code and run app. it worked like a charm. maybe you have any other problem. try to test it on any other device
– Ali Ahmed
Nov 15 '18 at 6:24
|
show 5 more comments
1 Answer
1
active
oldest
votes
Try this code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
/>
</LinearLayout
Thks, but I have to use a RelativeLayout
– H. Riantsoa
Nov 15 '18 at 5:58
May be it is because of the style u have used
– Athira
Nov 15 '18 at 6:10
Try to change the style
– Athira
Nov 15 '18 at 6:10
Same result, removing alignBaseline makes EditText visible but it's not the expected result
– H. Riantsoa
Nov 15 '18 at 6:18
I tried your code , its working for me. Which device are you using?
– Athira
Nov 15 '18 at 6:25
|
show 5 more comments
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%2f53312806%2fedittext-appears-in-design-but-not-in-the-real-apk%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
/>
</LinearLayout
Thks, but I have to use a RelativeLayout
– H. Riantsoa
Nov 15 '18 at 5:58
May be it is because of the style u have used
– Athira
Nov 15 '18 at 6:10
Try to change the style
– Athira
Nov 15 '18 at 6:10
Same result, removing alignBaseline makes EditText visible but it's not the expected result
– H. Riantsoa
Nov 15 '18 at 6:18
I tried your code , its working for me. Which device are you using?
– Athira
Nov 15 '18 at 6:25
|
show 5 more comments
Try this code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
/>
</LinearLayout
Thks, but I have to use a RelativeLayout
– H. Riantsoa
Nov 15 '18 at 5:58
May be it is because of the style u have used
– Athira
Nov 15 '18 at 6:10
Try to change the style
– Athira
Nov 15 '18 at 6:10
Same result, removing alignBaseline makes EditText visible but it's not the expected result
– H. Riantsoa
Nov 15 '18 at 6:18
I tried your code , its working for me. Which device are you using?
– Athira
Nov 15 '18 at 6:25
|
show 5 more comments
Try this code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
/>
</LinearLayout
Try this code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text:"
/>
<EditText
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="type ur text here"
/>
</LinearLayout
edited Nov 17 '18 at 8:50
halfer
14.7k759116
14.7k759116
answered Nov 15 '18 at 5:56
AthiraAthira
544221
544221
Thks, but I have to use a RelativeLayout
– H. Riantsoa
Nov 15 '18 at 5:58
May be it is because of the style u have used
– Athira
Nov 15 '18 at 6:10
Try to change the style
– Athira
Nov 15 '18 at 6:10
Same result, removing alignBaseline makes EditText visible but it's not the expected result
– H. Riantsoa
Nov 15 '18 at 6:18
I tried your code , its working for me. Which device are you using?
– Athira
Nov 15 '18 at 6:25
|
show 5 more comments
Thks, but I have to use a RelativeLayout
– H. Riantsoa
Nov 15 '18 at 5:58
May be it is because of the style u have used
– Athira
Nov 15 '18 at 6:10
Try to change the style
– Athira
Nov 15 '18 at 6:10
Same result, removing alignBaseline makes EditText visible but it's not the expected result
– H. Riantsoa
Nov 15 '18 at 6:18
I tried your code , its working for me. Which device are you using?
– Athira
Nov 15 '18 at 6:25
Thks, but I have to use a RelativeLayout
– H. Riantsoa
Nov 15 '18 at 5:58
Thks, but I have to use a RelativeLayout
– H. Riantsoa
Nov 15 '18 at 5:58
May be it is because of the style u have used
– Athira
Nov 15 '18 at 6:10
May be it is because of the style u have used
– Athira
Nov 15 '18 at 6:10
Try to change the style
– Athira
Nov 15 '18 at 6:10
Try to change the style
– Athira
Nov 15 '18 at 6:10
Same result, removing alignBaseline makes EditText visible but it's not the expected result
– H. Riantsoa
Nov 15 '18 at 6:18
Same result, removing alignBaseline makes EditText visible but it's not the expected result
– H. Riantsoa
Nov 15 '18 at 6:18
I tried your code , its working for me. Which device are you using?
– Athira
Nov 15 '18 at 6:25
I tried your code , its working for me. Which device are you using?
– Athira
Nov 15 '18 at 6:25
|
show 5 more comments
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%2f53312806%2fedittext-appears-in-design-but-not-in-the-real-apk%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
Can you post the Screen Shot also
– Sniffer
Nov 15 '18 at 5:11
Try to change the theme in your Style file. You can share your style file code here so that I can assist you.
– Rahul Sharma
Nov 15 '18 at 5:16
2
Change
android:layout_alignBaseline="@id/label"
toandroid:layout_alignBaseline="@+id/label"
,android:layout_toRightOf="@id/label"
toandroid:layout_toRightOf="@+id/label"
,android:layout_toEndOf="@id/label" to
android:layout_toEndOf="@+id/label"
– Piyush
Nov 15 '18 at 5:17
1
Remove
android:layout_alignBaseline="@id/label"
– Jared Rummler
Nov 15 '18 at 6:09
1
copy pasted your code and run app. it worked like a charm. maybe you have any other problem. try to test it on any other device
– Ali Ahmed
Nov 15 '18 at 6:24