Android: EditText hint in single line
For setting the Single Line in EditText
we use android:singleLine="true"
but I want to set the single line for the Hint Text, it is large and I want to show it in a one line like:
http://google.myopenid.stackoverflow.com
I am using the following code:
<EditText android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/defaultUrl"
android:singleLine="true" />
Note: defaultUrl
is dynamic and very long URL.
android android-edittext hint
add a comment |
For setting the Single Line in EditText
we use android:singleLine="true"
but I want to set the single line for the Hint Text, it is large and I want to show it in a one line like:
http://google.myopenid.stackoverflow.com
I am using the following code:
<EditText android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/defaultUrl"
android:singleLine="true" />
Note: defaultUrl
is dynamic and very long URL.
android android-edittext hint
so you wan tht hint url should be displayed at only as one line?
– chikka.anddev
Feb 2 '11 at 5:52
you are using this long Hint Text in one line and does it make any sense when user won't be able to read all at once?
– Vikas Patidar
Feb 2 '11 at 5:54
I am trying to show only the small url and then append like google.com/...
– Sameer Z.
Feb 2 '11 at 6:17
add a comment |
For setting the Single Line in EditText
we use android:singleLine="true"
but I want to set the single line for the Hint Text, it is large and I want to show it in a one line like:
http://google.myopenid.stackoverflow.com
I am using the following code:
<EditText android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/defaultUrl"
android:singleLine="true" />
Note: defaultUrl
is dynamic and very long URL.
android android-edittext hint
For setting the Single Line in EditText
we use android:singleLine="true"
but I want to set the single line for the Hint Text, it is large and I want to show it in a one line like:
http://google.myopenid.stackoverflow.com
I am using the following code:
<EditText android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/defaultUrl"
android:singleLine="true" />
Note: defaultUrl
is dynamic and very long URL.
android android-edittext hint
android android-edittext hint
edited Feb 26 '12 at 18:51
Idolon
22.5k1081106
22.5k1081106
asked Feb 2 '11 at 5:40
Sameer Z.Sameer Z.
2,39474071
2,39474071
so you wan tht hint url should be displayed at only as one line?
– chikka.anddev
Feb 2 '11 at 5:52
you are using this long Hint Text in one line and does it make any sense when user won't be able to read all at once?
– Vikas Patidar
Feb 2 '11 at 5:54
I am trying to show only the small url and then append like google.com/...
– Sameer Z.
Feb 2 '11 at 6:17
add a comment |
so you wan tht hint url should be displayed at only as one line?
– chikka.anddev
Feb 2 '11 at 5:52
you are using this long Hint Text in one line and does it make any sense when user won't be able to read all at once?
– Vikas Patidar
Feb 2 '11 at 5:54
I am trying to show only the small url and then append like google.com/...
– Sameer Z.
Feb 2 '11 at 6:17
so you wan tht hint url should be displayed at only as one line?
– chikka.anddev
Feb 2 '11 at 5:52
so you wan tht hint url should be displayed at only as one line?
– chikka.anddev
Feb 2 '11 at 5:52
you are using this long Hint Text in one line and does it make any sense when user won't be able to read all at once?
– Vikas Patidar
Feb 2 '11 at 5:54
you are using this long Hint Text in one line and does it make any sense when user won't be able to read all at once?
– Vikas Patidar
Feb 2 '11 at 5:54
I am trying to show only the small url and then append like google.com/...
– Sameer Z.
Feb 2 '11 at 6:17
I am trying to show only the small url and then append like google.com/...
– Sameer Z.
Feb 2 '11 at 6:17
add a comment |
3 Answers
3
active
oldest
votes
You can use
android:ellipsize="end"
android:maxLines="1"
to show your hint text in single line but you wont be able to see the whole text because
android:ellipsize="end"
truncates the text at the end.
add a comment |
Same issue.
Solution:
EditText.setHint("hint content".replace("n"," "))
1
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post instead, provide answers that don't require clarification from the asker
– Agilanbu
Nov 23 '18 at 7:24
add a comment |
You can try using
android:maxLines="1"
1
I try it already ,it is not working. thanks for you support.If have any other idea or can just tell me how to customize the class.
– Sameer Z.
Feb 2 '11 at 6:15
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%2f4871152%2fandroid-edittext-hint-in-single-line%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
You can use
android:ellipsize="end"
android:maxLines="1"
to show your hint text in single line but you wont be able to see the whole text because
android:ellipsize="end"
truncates the text at the end.
add a comment |
You can use
android:ellipsize="end"
android:maxLines="1"
to show your hint text in single line but you wont be able to see the whole text because
android:ellipsize="end"
truncates the text at the end.
add a comment |
You can use
android:ellipsize="end"
android:maxLines="1"
to show your hint text in single line but you wont be able to see the whole text because
android:ellipsize="end"
truncates the text at the end.
You can use
android:ellipsize="end"
android:maxLines="1"
to show your hint text in single line but you wont be able to see the whole text because
android:ellipsize="end"
truncates the text at the end.
answered Feb 2 '11 at 6:27
Vikas PatidarVikas Patidar
33.7k2184100
33.7k2184100
add a comment |
add a comment |
Same issue.
Solution:
EditText.setHint("hint content".replace("n"," "))
1
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post instead, provide answers that don't require clarification from the asker
– Agilanbu
Nov 23 '18 at 7:24
add a comment |
Same issue.
Solution:
EditText.setHint("hint content".replace("n"," "))
1
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post instead, provide answers that don't require clarification from the asker
– Agilanbu
Nov 23 '18 at 7:24
add a comment |
Same issue.
Solution:
EditText.setHint("hint content".replace("n"," "))
Same issue.
Solution:
EditText.setHint("hint content".replace("n"," "))
edited Nov 23 '18 at 8:03
Shree
12.7k2070122
12.7k2070122
answered Nov 23 '18 at 7:17
XugterXugter
11
11
1
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post instead, provide answers that don't require clarification from the asker
– Agilanbu
Nov 23 '18 at 7:24
add a comment |
1
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post instead, provide answers that don't require clarification from the asker
– Agilanbu
Nov 23 '18 at 7:24
1
1
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post instead, provide answers that don't require clarification from the asker
– Agilanbu
Nov 23 '18 at 7:24
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post instead, provide answers that don't require clarification from the asker
– Agilanbu
Nov 23 '18 at 7:24
add a comment |
You can try using
android:maxLines="1"
1
I try it already ,it is not working. thanks for you support.If have any other idea or can just tell me how to customize the class.
– Sameer Z.
Feb 2 '11 at 6:15
add a comment |
You can try using
android:maxLines="1"
1
I try it already ,it is not working. thanks for you support.If have any other idea or can just tell me how to customize the class.
– Sameer Z.
Feb 2 '11 at 6:15
add a comment |
You can try using
android:maxLines="1"
You can try using
android:maxLines="1"
answered Feb 2 '11 at 5:51
amiekuseramiekuser
1,38711530
1,38711530
1
I try it already ,it is not working. thanks for you support.If have any other idea or can just tell me how to customize the class.
– Sameer Z.
Feb 2 '11 at 6:15
add a comment |
1
I try it already ,it is not working. thanks for you support.If have any other idea or can just tell me how to customize the class.
– Sameer Z.
Feb 2 '11 at 6:15
1
1
I try it already ,it is not working. thanks for you support.If have any other idea or can just tell me how to customize the class.
– Sameer Z.
Feb 2 '11 at 6:15
I try it already ,it is not working. thanks for you support.If have any other idea or can just tell me how to customize the class.
– Sameer Z.
Feb 2 '11 at 6:15
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%2f4871152%2fandroid-edittext-hint-in-single-line%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
so you wan tht hint url should be displayed at only as one line?
– chikka.anddev
Feb 2 '11 at 5:52
you are using this long Hint Text in one line and does it make any sense when user won't be able to read all at once?
– Vikas Patidar
Feb 2 '11 at 5:54
I am trying to show only the small url and then append like google.com/...
– Sameer Z.
Feb 2 '11 at 6:17