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

  • SEARCH
  • Home
  • 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 7605945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:17:31+00:00 2026-05-31T00:17:31+00:00

I use an XML file to define a Dialog that is shown to the

  • 0

I use an XML file to define a Dialog that is shown to the user.
I’d like to be able to scroll TextViews and EditTexts but show OK and Cancel buttons at all the times. I’m not managing to do that.
Here’s my Layout file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content">

        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:orientation="vertical" 
            android:scrollbars="vertical"
            android:scrollbarAlwaysDrawVerticalTrack="true">

            <!-- Group Name -->
            <TextView android:id="@+id/group_name_view"
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:layout_marginLeft="20dip" 
                android:layout_marginRight="20dip"
                android:text="@string/group_name_view_text" 
                android:gravity="left"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <EditText android:id="@+id/group_name_edit"
                android:layout_height="wrap_content" 
                android:layout_width="fill_parent"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:scrollHorizontally="true" 
                android:autoText="false"
                android:capitalize="none" 
                android:gravity="fill_horizontal"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <!-- Group Description -->
            <TextView android:id="@+id/group_description_view"
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:text="@string/group_description_view_text" 
                android:gravity="left"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <EditText android:id="@+id/group_description_edit"
                android:layout_height="wrap_content" 
                android:layout_width="fill_parent"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:scrollHorizontally="true" 
                android:autoText="false"
                android:capitalize="none" 
                android:gravity="fill_horizontal"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <!-- Access security -->

            <TextView android:id="@+id/access_security_view"
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:text="@string/access_security_view_text" 
                android:gravity="left"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <Spinner android:id="@+id/access_spinner"
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:gravity="fill_horizontal" 
                android:drawSelectorOnTop="true"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <!-- Communications security -->
            <TextView android:id="@+id/communcations_security_view"
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:text="@string/communcations_security_view_text"
                android:gravity="left" 
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <Spinner android:id="@+id/communications_spinner"
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:gravity="fill_horizontal" 
                android:drawSelectorOnTop="true"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <!-- User -->
            <TextView android:id="@+id/username_view"
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:text="@string/username_view_text" 
                android:gravity="left"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <EditText android:id="@+id/username_edit" 
               android:enabled="false"
                android:layout_height="wrap_content" 
                android:layout_width="fill_parent"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:scrollHorizontally="true" 
                android:autoText="false"
                android:capitalize="none" 
                android:gravity="fill_horizontal"
                android:textAppearance="?android:attr/textAppearanceMedium" />
            <!-- Password -->
            <TextView android:id="@+id/password_view"
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:text="@string/password_view_text" 
                android:gravity="left"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <EditText android:id="@+id/password_edit" 
            android:enabled="false"
                android:layout_height="wrap_content" 
                android:layout_width="fill_parent"
                android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
                android:scrollHorizontally="true" 
                android:autoText="false"
                android:capitalize="none" 
                android:gravity="fill_horizontal"
                android:password="true" android:textAppearance="?android:attr/textAppearanceMedium" />

        </LinearLayout>
    </ScrollView>
    <LinearLayout android:layout_height="wrap_content"
        android:layout_width="fill_parent" >
        <Button android:layout_height="wrap_content"
                 android:layout_width="wrap_content" 
                 android:text="@string/ok_text"
                 android:layout_weight="1" android:id="@+id/group_creator_ok_button">
       </Button>
        <Button android:layout_height="wrap_content"
                 android:layout_width="wrap_content" 
                 android:text="@string/cancel_text"
                 android:layout_weight="1" 
                 android:id="@+id/group_creator_cancel_button">
       </Button>
    </LinearLayout>
</LinearLayout>

I’ve extended Dialog class so when onCreate is called I call

setContentView(R.layout.my_layout_file);

It is just showing me the ScrollView, but not the layout with the buttons… So I’m not even able to push the buttons.

  • 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-05-31T00:17:32+00:00Added an answer on May 31, 2026 at 12:17 am

    just changed your ScrollView height like this

    <ScrollView 
        android:layout_width="fill_parent" 
        android:layout_height="380dp">
    

    and there is no need to write

    xmlns:android="http://schemas.android.com/apk/res/android"
    

    on every tag it needs only on first tag

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

Sidebar

Related Questions

I have this use case of an xml file with input like Input: <abc
I using SiteMapPath with an xml file for data. I would like to use
I can currently use sgml-pretty-print to pretty print an xml file in emacs, but
So I have a PHP file that I use to define all my constants
I thought I'd be classy and use the string.xml file to define some constant
sI have an XML file that looks like the following... <a> <b> <version>1.0</version> <c>
I use an XML file in App_Data in conjunction with a Repeater on the
Is it possible to use single XML file for Ruby on Rails as an
I'm having trouble understanding why I would use a context.xml file to declare a
I use a xsl tranform to convert a xml file to html in dotNet.

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.