Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8096597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:30:08+00:00 2026-06-05T21:30:08+00:00

I am new in Android. Now I need EditText which should be no more

  • 0

I am new in Android.

Now I need EditText which should be no more than a certain size. Now I try to use this code:

 <EditText
        android:id="@+id/editText"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="top"
        android:inputType="text|textMultiLine"
        android:minLines="3" />

layout_height=”wrap_content” – in this case my EditText height is equal to the number of letters in it.

But I need make restriction for height for example set height for EditText no more than of center screen.

I know that we have some problem because Android use many of different screen.

Have we got a way for calculate this height. I mean the bottom border of EditText should not be more than center of screen.

Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:30:11+00:00Added an answer on June 5, 2026 at 9:30 pm

    You can restrict an EditText by adding additional values

    android:maxLines
    

    Furthermore you could add

    android:maxHeight
    

    with some kind of dp value.

    I wouldn’t use other techniques for restricting the height.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im new to android development. Now im trying to use sqlite db. I created
I'm new in this area...I need to create SIP client for android... I fallow
I'm new to android programming (writing my first app now) and I need some
I'm new to Android. I'm developing an app which blocks unwanted calls. Now I'm
I am new to android development,now I am working on C2DM implementation for android
I am new in Android. I have develop an app. And now want to
friends I am new to iphone development, I have mostly worked with Android, now
I am a new android app developer and i want to use google map
i am new to android.i have one single activity with main.xml file. Now, i
I am working on new app development in android. I need to launch an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.