I searched a lot but nothing seems to work in my case. Here is what I want to achieve using relative layout.
below is my xml code for it.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:focusable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/microphone" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/white"
android:padding="#dimen/padding_16">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:drawableRight="#drawable/arrow"
android:text="#string/next"
android:textAllCaps="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/arrow"
android:text="#string/previous"
android:textAllCaps="true" />
</RelativeLayout>
By doing this the microphone is hidden behind the Next-Previous Strip. I guess there is some parameter to control the view height in z-axis but I don't remember that and will it work below Lolipop too. Please help.
If you want to show your "Microphone Layout", you don't have to do much with your current layout(xml)
Just put your "Microphone Relative Layout" after "Previous and Next Relative Layout", like below
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/white"
android:padding="#dimen/padding_16">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:drawableRight="#drawable/arrow"
android:text="#string/next"
android:textAllCaps="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/arrow"
android:text="#string/previous"
android:textAllCaps="true"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:focusable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/microphone"/>
</RelativeLayout>
</RelativeLayout>
Hope this helps you.
Related
I have a problem, to show my image in android.
For this, you can see below the output of my emulator.
I have a ScrollView with 2 childrean.
One is the TextView, and the other one is the ImageView.
When I scroll down, I can only see the text of the TextView.
But not the image of the Imageview.
Here is a part of my layout:
<RelativeLayout
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_marginLeft="260dp"
android:layout_marginBottom="50dp"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/text_handlungsleitfaden_strassenfuehrer"
android:layout_marginTop="10dp"
android:scrollbars="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:id="#+id/bild_handlungsleitfaden_strassenfuehrer"
android:layout_marginTop="10dp"
android:src="#drawable/maschine"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
<Button
android:id="#+id/handlungsleitfaden_btn"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:textAllCaps="false"
android:text="weiter" />
</RelativeLayout>
Does anybody have an idea how to fix it? :)
Thank you
just provide orientation to linearLayout, By default orientation is horizontal so you have to provide android:orientation="vertical" like this :
<ScrollView
android:layout_marginLeft="260dp"
android:layout_marginBottom="50dp"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/text_handlungsleitfaden_strassenfuehrer"
android:layout_marginTop="10dp"
android:scrollbars="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:id="#+id/bild_handlungsleitfaden_strassenfuehrer"
android:layout_marginTop="10dp"
android:src="#drawable/maschine"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
<Button
android:id="#+id/handlungsleitfaden_btn"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:textAllCaps="false"
android:text="weiter" />
</RelativeLayout>
The problem is , You didn't set orientation for the linearlayout.
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
Try adding,
android:orientation="vertical"
You are forgetting to give orientation to linear layout.
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
I hope this will work for you
Add below line to LinearLayout
android:orientation="vertical"
And add below line to ScrollView
android:fillViewport="true"
Give orientation in Linear layout
android:orientation = "vertical"
Try this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/text_handlungsleitfaden_strassenfuehrer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Nilesgh Eayjdfp"
android:scrollbars="vertical" />
<ImageView
android:id="#+id/bild_handlungsleitfaden_strassenfuehrer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:src="#drawable/abc" />
</LinearLayout>
</ScrollView>
<Button
android:id="#+id/handlungsleitfaden_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="7dp"
android:text="weiter"
android:textAllCaps="false" />
</RelativeLayout>
Unfortunately you forgot this line
android:orientation="vertical"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
I've created the following splash screen layout using android developer studio. I wanted to center the content which consist of two text views and an image view. The following is the XML.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/splash_gradient">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView id="#+id/splashscreen"
android:layout_width="100dp"
android:layout_height="250dp"
android:paddingBottom="100dp"
android:layout_centerInParent="true"
android:gravity="center_vertical|center_horizontal"
android:src="#drawable/splash_logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample"
android:layout_centerInParent="true"
android:fontFamily="#string/font_family_thin"
android:paddingTop="90dp"
android:paddingRight="90dp"
android:textSize="35dp"
android:textColor="#fff"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="App"
android:layout_centerInParent="true"
android:fontFamily="#string/font_family_regular"
android:textSize="35dp"
android:paddingTop="90dp"
android:paddingLeft="100dp"
android:textColor="#fff"
/>
</RelativeLayout>
This will look as following image.
Is this the correct way to center my content or is there a better way to achieve what I'm looking for? Please guide me. Thanks in advance.
If you are using padding to center the elements, it is the wrong way because you will get different results with different screens.
See this alternative, it is not the only one.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/splash_gradient"
android:gravity="center">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<ImageView
android:id="#+id/splashscreen"
android:layout_width="100dp"
android:layout_height="250dp"
android:paddingBottom="100dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="#drawable/splash_logo" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/splashscreen"
android:layout_centerHorizontal="true"
android:orientation="horizontal"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample"
android:textSize="35dp"
android:textColor="#fff"
android:layout_marginEnd="15dp"
android:layout_marginRight="10dp"
android:fontFamily="#string/font_family_thin"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="App"
android:layout_centerInParent="true"
android:textSize="35dp"
android:textColor="#fff"
android:fontFamily="#string/font_family_regular"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
first DO NOT use padding or margin to align Views with respect to siblings views or layout, it will look great in 1 device but won't in other devices with different screen sizes. Use layout_align attribute. Learn Linear layout properties here. Then you will able to discover best way by your self.
my solution
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/image"
android:layout_width="100dp"
android:layout_height="250dp"
android:layout_centerInParent="true"
/>
<LinearLayout
android:layout_centerInParent="true"
android:layout_below="#+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/sample"
android:layout_alignBottom="#+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample"
android:layout_centerInParent="true"
android:textSize="35dp"
android:textColor="#000"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" App"
android:textSize="35dp"
android:textColor="#000"
/>
</LinearLayout>
</RelativeLayout>
I have searched around and they all mention about changing the layout_height to wrap_content but mine is already in wrap_content. I really can't identify any error. Any help is welcome. Thanks in advance!
Screenshot of problem
<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="wrap_content"
tools:context="com.fyp.ipptapp.UI.StandardFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/test"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp"
android:text="Age" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp"
android:text="Gender" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<Spinner
android:id="#+id/spinner_Age"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_margin="5dp"
android:dropDownWidth="50dp" />
<Spinner
android:id="#+id/spinner_Gender"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_margin="5dp"
android:dropDownWidth="50dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp"
android:text="Voc" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:padding="15dp"
android:text="Pop Gp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<Spinner
android:id="#+id/spinner_Voc"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_margin="5dp"
android:dropDownWidth="200dp" />
<Spinner
android:id="#+id/spinner_PopGp"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_margin="5dp"
android:dropDownWidth="120dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/test"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp"
android:text="Exemption" />
<CheckBox
android:id="#+id/pushUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Push Up" />
<CheckBox
android:id="#+id/sitUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sit Up" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout2">
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout2" />
</LinearLayout>
</RelativeLayout>
In your adapter xml parent layout height might be set to match_parent. Check it once
In your item.xml(or where you have the structure for each item in recycler) check whether the android:layout_width="wrap_content" and android:layout_height="wrap_content" like this.
Something like this :
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
This will set the height and width according to the content within the item.
Hope this helped!
give some top margin to your layout.
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout2" />
</LinearLayout>
you are looking for the wrong xml file, add you inside item xml the one used at your Adapter not the RecyclerView one
I think #MinnuKaAnae has answered the question, but I still want to use some layout UIs to show the answer. I simulate the issue on my side.
Obviously, the owner provided the wrong layout file, we need the item layout.
How to add scrolling feature to this layout please help
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarAlwaysDrawVerticalTrack="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/viewA"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:background="#android:color/holo_purple"
android:orientation="horizontal">
<ImageView
android:layout_height="100dp"
android:layout_width="match_parent"
android:scaleType="fitXY"
android:id="#+id/expanded_thumbnail"/>
</LinearLayout>
<RelativeLayout
android:id="#+id/viewB"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:background="#android:color/white"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sangam 2015"
android:textStyle="bold"
android:textSize="15sp"
android:id="#+id/expanded_title"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="33dp"
android:layout_marginStart="33dp"
android:layout_marginTop="31dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8-10th September 2015"
android:textSize="10dp"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:id="#+id/expanded_date"
android:layout_below="#+id/expanded_title"
android:layout_alignLeft="#+id/expanded_title"
android:layout_alignStart="#+id/expanded_title" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="My name is dushyant suthar"
android:id="#+id/expanded_description"
android:gravity="left"
android:layout_marginTop="12dp"
android:layout_below="#+id/expanded_date"
android:layout_alignLeft="#+id/expanded_date"
android:layout_alignStart="#+id/expanded_date" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
app:layout_anchor="#id/viewA"
app:layout_anchorGravity="bottom|right|end"/>
When I am using the above code the ImageView is getting small (the height of image is getting decreased) and noting like scrolling in The whole layout.
I dont know about Scroll views I did not understand by googling I want a good link and also solution of above XML and what should I add in Java code
your code seems ok to me but try by removing android.support.design.widget.CoordinatorLayout import or android:scrollbarAlwaysDrawVerticalTrack="true"
Below is my XML code, I want the whole view to scroll, but it's just not working, please help, with what's wrong;
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/app_icon"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal"/>
<TextView
android:id="#+id/textView_app_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center"/>
<TextView
android:id="#+id/textView_content"
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_height="386dp"
android:gravity="center"></TextView>
</LinearLayout>
</ScrollView>
I've tried using,
android:fillViewport="true"
but of no help.
A ScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects.
So here you have to take LinearLayout or RelativeLayout and then you have to put different hierarchy of component.
Android : buttons not visible in scrollview
here i have given answer of Some problem so you can follow this for solve your problem with clearing your concept.
Try like this ,Scrolling will work till End
<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">
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/app_icon"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal"/>
<TextView
android:id="#+id/textView_app_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center"/>
<TextView
android:id="#+id/textView_content"
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_height="386dp"
android:gravity="center"/>
</LinearLayout>
</ScrollView>
</Relativelayout>
If ScrollView fits to your device screen it would not be scrollable, so make sure content inside ScrollView takes space larger than your screen size.
systematix Try this,here you getting scroll.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:src="#mipmap/ic_launcher" />
<TextView
android:id="#+id/textView_app_version1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:text="hello" />
<TextView
android:id="#+id/textView_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="fahfhahffshfs fsfhshf fshfs sflshf sflsh fhsfhslfh fshflshf hslfh slfhslfhslfhs fhslhf"></TextView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:src="#mipmap/ic_launcher" />
<TextView
android:id="#+id/textView_app_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:text="hello" />
<TextView
android:id="#+id/textView_content1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="fahfhahffshfs fsfhshf fshfs sflshf sflsh fhsfhslfh fshflshf hslfh slfhslfhslfhs fhslhf"></TextView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:src="#mipmap/ic_launcher" />
<TextView
android:id="#+id/textView_app_version2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:text="hello" />
<TextView
android:id="#+id/textView_content3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="fahfhahffshfs fsfhshf fshfs sflshf sflsh fhsfhslfh fshflshf hslfh slfhslfhslfhs fhslhf"></TextView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:src="#mipmap/ic_launcher" />
<TextView
android:id="#+id/textView_app_version4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:text="hello" />
<TextView
android:id="#+id/textView_content4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="fahfhahffshfs fsfhshf fshfs sflshf sflsh fhsfhslfh fshflshf hslfh slfhslfhslfhs fhslhf"></TextView>
</LinearLayout>