This is my register layout. The views which are below password i.e spinners,buttons are not showing up in my phone but its showing up in the emulator...My emualtor is based on nexus 7 whereas my phone is samsung grand..I m wondering what is happening there..Is something wrong in my code.
please help
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#drawable/gradient"
>
<ImageView
android:id="#+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/topimg" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#000750"
android:padding="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="50dp"
android:layout_marginLeft="20dp"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#fff"
android:id="#+id/register_error"
android:textSize="15dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="left"
android:textSize="15dp"
android:textColor="#000"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:id="#+id/fname"
android:background="#FFF"
android:hint="#string/name"
></EditText>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="left"
android:textSize="15dp"
android:textColor="#000"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:id="#+id/lname"
android:background="#FFF"
android:hint="#string/lname"
></EditText>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="left"
android:textSize="15dp"
android:textColor="#000"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:id="#+id/uname"
android:background="#FFF"
android:hint="#string/username"
></EditText>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="left"
android:textSize="15dp"
android:textColor="#000"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:id="#+id/email"
android:background="#FFF"
android:hint="#string/semail"
></EditText>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="left"
android:textSize="15dp"
android:textColor="#000"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:id="#+id/pword"
android:background="#FFF"
android:hint="#string/password"
android:password="true"
></EditText>
<Spinner
android:id="#+id/spinner1"
android:spinnerMode="dialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select"
android:entries="#array/level_arrays"
android:prompt="#string/level_prompt"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:background="#FFF"
/>
<Spinner
android:id="#+id/spinner2"
android:spinnerMode="dialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="#array/class_arrays"
android:prompt="#string/class_prompt"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:background="#FFF"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:textSize="20dp"
android:textColor="#FFF"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="Enroll"
android:id="#+id/register"
android:background="#589700"
></Button>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:textSize="20dp"
android:textColor="#FFF"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="Back To Login"
android:id="#+id/bktologin"
android:background="#589700"
></Button>
</LinearLayout>
</LinearLayout>
Problem is the height of your inner linear layout is more than the screen size. To solve this problem, you can add a extra scroll view and put this linear layout to the scroll view.
Related
Good day!
I'll start with the 2 issues:
1.- I want a LinearLayour to autoadjust his content whenever necessary (Because I disabled an element on the layout).
2.- Clone a LinearLayout entirely depending on the size of an Array.
I have this code (yes, it is pretty big):
<TextView
android:id="#+id/textTitleScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginStart="15dp"
android:text="Votaciones"
android:fontFamily="#font/segoeprint"
android:textColor="#color/ourBlack3"
android:contentDescription="#string/titleFinalEvent"
android:textSize="28sp"/>
<RelativeLayout
android:id="#+id/constraint_team"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="activateContent"
android:background="#drawable/finaleventteambackground"
android:backgroundTint="#color/ourOrange">
<ImageView
android:id="#+id/imageView"
android:layout_width="80dp"
android:layout_height="50dp"
android:layout_alignParentStart="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="10dp"
android:layout_centerVertical="true"
android:scaleType="fitXY"
android:src="#mipmap/littlelogomc" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
android:text="Equipo 1"
android:fontFamily="#font/seguisbi"
android:textColor="#color/ourWhite"
android:layout_marginRight="30dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginBottom="10dp"/>
</RelativeLayout>
<LinearLayout
android:id="#+id/team1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#drawable/finaleventteambackground">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:fontFamily="#font/segoeprint"
android:textColor="#color/ourBlack3"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:text="Presentación"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<SeekBar
android:id="#+id/seekBarPresentation"
android:layout_width="240dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:progressDrawable="#drawable/custom_seekbar"
android:thumb="#drawable/thumb"/>
<RelativeLayout
android:layout_width="70dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:background="#drawable/edittextbackground"
android:layout_marginRight="20dp"
android:layout_alignParentEnd="true">
<EditText
android:id="#+id/editTextPresentation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_marginRight="5dp"
android:textAlignment="gravity"
android:layout_centerVertical="true"
android:textSize="20sp"
android:inputType="number"
android:background="#android:color/transparent"
android:hint="0"/>
</RelativeLayout>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:fontFamily="#font/segoeprint"
android:textColor="#color/ourBlack3"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:text="Servicio"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<SeekBar
android:id="#+id/seekBarService"
android:layout_width="240dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:progressDrawable="#drawable/custom_seekbar"
android:thumb="#drawable/thumb"/>
<RelativeLayout
android:layout_width="70dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:background="#drawable/edittextbackground"
android:layout_marginRight="20dp"
android:layout_alignParentEnd="true">
<EditText
android:id="#+id/editTextService"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_marginRight="5dp"
android:textAlignment="gravity"
android:layout_centerVertical="true"
android:textSize="20sp"
android:inputType="number"
android:background="#android:color/transparent"
android:hint="0"/>
</RelativeLayout>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:fontFamily="#font/segoeprint"
android:textColor="#color/ourBlack3"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:text="Sabor"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<SeekBar
android:id="#+id/seekBarFlavour"
android:layout_width="240dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:progressDrawable="#drawable/custom_seekbar"
android:thumb="#drawable/thumb"/>
<RelativeLayout
android:layout_width="70dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:background="#drawable/edittextbackground"
android:layout_marginRight="20dp"
android:layout_alignParentEnd="true">
<EditText
android:id="#+id/editTextFlavour"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_marginRight="5dp"
android:textAlignment="gravity"
android:layout_centerVertical="true"
android:textSize="20sp"
android:inputType="number"
android:background="#android:color/transparent"
android:hint="0"/>
</RelativeLayout>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:fontFamily="#font/segoeprint"
android:textColor="#color/ourBlack3"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:text="Imagen"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<SeekBar
android:id="#+id/seekBarImage"
android:layout_width="240dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:progressDrawable="#drawable/custom_seekbar"
android:thumb="#drawable/thumb"/>
<RelativeLayout
android:layout_width="70dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:background="#drawable/edittextbackground"
android:layout_marginRight="20dp"
android:layout_alignParentEnd="true">
<EditText
android:id="#+id/editTextImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_marginRight="5dp"
android:textAlignment="gravity"
android:layout_centerVertical="true"
android:textSize="20sp"
android:inputType="number"
android:background="#android:color/transparent"
android:hint="0"/>
</RelativeLayout>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:fontFamily="#font/segoeprint"
android:textColor="#color/ourBlack3"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:text="TrÃptico"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<SeekBar
android:id="#+id/seekBarTriptych"
android:layout_width="240dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:progressDrawable="#drawable/custom_seekbar"
android:thumb="#drawable/thumb"/>
<RelativeLayout
android:layout_width="70dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:background="#drawable/edittextbackground"
android:layout_marginRight="20dp"
android:layout_alignParentEnd="true">
<EditText
android:id="#+id/editTextTriptych"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_marginRight="5dp"
android:textAlignment="gravity"
android:layout_centerVertical="true"
android:textSize="20sp"
android:inputType="number"
android:background="#android:color/transparent"
android:hint="0"/>
</RelativeLayout>
</RelativeLayout>
<androidx.appcompat.widget.AppCompatButton
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="20dp"
android:enabled="false"
android:background="#drawable/roundedbutton"
android:backgroundTint="#color/ourOrange"
android:text="Votar"
android:fontFamily="#font/segoeprint"
android:textFontWeight="700"
android:textColor="#color/ourWhite"
android:layout_gravity="center"
android:textSize="18sp"/>
</LinearLayout>
</LinearLayout>
The first RelativeLayout (+id/constraint_team), has an OnClick() event which disables or enables the next children LinearLayout (#+id/team1). But the parent LinearLayout(#+id/linear_score) doesn't adjust when I disable the children LinearLayout.
I was trying to achieve this with this code:
if (linearLayout.isEnabled())
{
for (int i = 0; i < linearLayout.getChildCount(); i++)
{
View v = linearLayout.getChildAt(i);
v.setVisibility(View.INVISIBLE);
v.setEnabled(false);
}
linearLayout.setVisibility(View.INVISIBLE);
linearLayout.setEnabled(false);
//linearLayoutScore.getLayoutParams().height = LinearLayout.LayoutParams.WRAP_CONTENT;
//ViewGroup.LayoutParams params = linearLayoutScore.getLayoutParams();
linearLayoutScore.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT));
linearLayoutScore.requestLayout();
}
(The comments are other unsuccessful attempts I have tried)
with this code, instead of only modifying the size of the parent LinearLayout, it modifies the entire screen to be only this parent LinearLayout. (I've read that set.LayoutParams only modify the layout height and width, but it doesn't seems to work like that).
For the second one I haven't found anything useful (maybe i'm just using really bad keyword on google), Basically if I receive a number, for example 3, I want to copy my child LinearLayout and my RelativeLayout (#+id/constraint_team and #+id/team1) that many times, How can I achieve this?
Thanks in advance
I used ScrollActivity that comes in android studio to create a cool animation while scrolling. The ScrollActivity came with two xml files which are content_scrolling.xml and activity_scrolling.xml. I would like to create sticky headers inside the content_scrolling.xml. I created sticky headers before but the problem I am having is that the header does not "stick" right under the image where I'd like it to instead it sticks on top of the screen which is blocked by the image. I have provided an image of what I am trying to accomplish and I hope it helps understand what I am trying to do. Thank you!
activity_scrolling.xml
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.myapplication.foodapp.ScrollingActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.PopupOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/imageView2"
android:layout_width="match_parent"
android:layout_height="545dp"
android:layout_alignParentTop="true"
android:scaleType="fitXY"
android:src="#mipmap/food1"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Chipotle Chicken Fajitas"
android:textSize="27sp"
android:layout_gravity="bottom"
android:layout_marginBottom="40dp"
android:layout_marginLeft="5dp"
android:textColor="#fff"
android:id="#+id/first_food_title"/>
<me.grantland.widget.AutofitTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="16 ingredients | 284 Calories | 1 hour"
android:singleLine="true"
android:textAlignment="center"
android:textColor="#fff"
android:layout_gravity="bottom"
android:textSize="20sp"
android:id="#+id/spec_text"/>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="200dp"
app:layout_collapseMode="pin"
/>
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#mipmap/arrow"
android:id="#id/back_Arrow"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
content_scrolling.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
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"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.myapplication.foodapp.ScrollingActivity"
android:id="#+id/nested_scroll_view">
<RelativeLayout
android:id="#+id/relative_layout1"
android:layout_width="match_parent"
android:layout_height="2000dp"
android:background="#fff">
<me.grantland.widget.AutofitTextView
android:id="#+id/spec_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="16 ingredients | 284 Calories | 1 hour"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20sp"
android:layout_alignBottom="#+id/imageView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
app:sizeToFit="true"/>
<View
android:layout_width="wrap_content"
android:layout_height="55dp"
android:background="#2C7873"
android:layout_below="#+id/imageView2"
android:layout_alignRight="#+id/imageView3"
android:layout_alignEnd="#+id/imageView3"
android:id="#+id/ingredient_view"
/>
<ImageView
android:layout_width="70dp"
android:layout_height="50dp"
android:id="#+id/imageView3"
android:src="#drawable/servings"
android:layout_alignBottom="#+id/relativeLayout"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Ingredients"
android:textColor="#fff"
android:textSize="24sp"
android:textStyle="bold"
android:paddingLeft="5dp"
android:paddingTop="15dp"
android:layout_below="#+id/imageView2"
android:layout_alignRight="#+id/imageView3"
android:layout_alignEnd="#+id/imageView3"
/>
<TextView
android:id="#+id/bullet_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="5px"
android:text="#string/_1_lb_boneless_skinless_chicken_breasts_cut_into_thin_strips"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_below="#+id/imageView3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/bullet_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_one"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_tsp_ground_cumin"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_two"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_tsp_chili_powder"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_four"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_three"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/kosher_salt"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_five"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_four"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/freshly_ground_black_pepper"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_six"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_five"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_tbsp_canola_oil"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_seven"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_six"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_red_bell_pepper_sliced"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_eight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_seven"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_small_onion_sliced"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_nine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_eight"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_c_sliced_mushrooms"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_ten"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_nine"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_3_garlic_cloves_chopped"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_elven"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_ten"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_tbsp_chopped_chipotles_in_adobo"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_twelve"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_ten"
android:layout_marginTop="29dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_1_2_tbsp_fresh_lime_juice"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_thirteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_twelve"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_8_warm_flour_tortillas"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_fithteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_thirteen"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/cilantro_for_serving"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_sixteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_fithteen"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/lime_wedges_for_serving"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_fourteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_sixteen"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/grated_cheddar_cheese_for_serving"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView23"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="10dp"
android:text="View Directions"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp"
android:layout_below="#+id/bullet_fourteen"
/>
<View
android:layout_width="wrap_content"
android:layout_height="55dp"
android:background="#2C7873"
android:layout_below="#+id/textView23"
android:layout_alignRight="#+id/imageView3"
android:layout_alignEnd="#+id/imageView3"
android:id="#+id/view2"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:tag="sticky"/>
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="10dp"
android:text="Nutrition Facts"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="24sp"
android:textStyle="bold"
android:layout_alignTop="#+id/view2"
android:layout_alignLeft="#+id/textView23"
android:layout_alignStart="#+id/textView23" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="View More"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="15sp"
android:layout_alignBottom="#+id/textView15"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="5dp"
android:layout_marginRight="5dp" />
<RelativeLayout
android:id="#+id/relativeLayout4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:paddingEnd="15dp"
android:paddingStart="30dp"
android:layout_below="#+id/view2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<ImageView
android:id="#+id/imageView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/protein" />
<ImageView
android:id="#+id/imageView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imageView18"
android:layout_toRightOf="#+id/imageView18"
android:src="#drawable/sodium" />
<ImageView
android:id="#+id/imageView20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imageView19"
android:layout_toRightOf="#+id/imageView19"
android:src="#drawable/fats" />
<ImageView
android:id="#+id/imageView21"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toEndOf="#+id/imageView20"
android:layout_toRightOf="#+id/imageView20"
android:src="#drawable/sugars" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#2C7873"
android:layout_below="#+id/relativeLayout4"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:id="#+id/view3"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:tag="sticky"/>
<TextView
android:id="#+id/textView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Reviews"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="24sp"
android:textStyle="bold"
android:layout_alignBottom="#+id/view3"
android:layout_alignLeft="#+id/textView15"
android:layout_alignStart="#+id/textView15" />
<RatingBar
android:id="#+id/ratingBar"
android:layout_width="230dp"
android:layout_height="35dp"
android:clickable="false"
android:numStars="5"
android:scaleX=".5"
android:scaleY=".5"
android:layout_alignTop="#+id/textView19"
android:layout_alignRight="#+id/textView16"
android:layout_alignEnd="#+id/textView16"
android:layout_marginTop="-5dp" />
<TextView
android:id="#+id/display_review"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#f1fcf0"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="20sp"
android:layout_below="#+id/view3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
Im new to android development and trying to learn what i don't
get is how i can style the XML below.
All tips and help are very welcome.
I have the following ListView XML
I want to create the following XML
Current XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="fill_parent">
<ImageView
android:id="#+id/LOC_IMAGE"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:width="38dp"
android:gravity="left"
android:src="#drawable/ondergrondse2" />
<TextView
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="15dp"
android:width="60dp"
android:gravity="center"
android:id="#+id/LOC_CODE" />
<TextView
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="15dp"
android:width="60dp"
android:gravity="center"
android:id="#+id/LOC_FRACTIE" />
<TextView
android:id="#+id/LOC_NAME"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Niet aanwezig"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:textSize="15dp"
android:width="330dp"
android:layout_marginRight="20dp" />
</LinearLayout>
I want the LOC_NAME TextView under the others ImageVIew And TextView like the picture below
Why downvoting im trying to learn something
You need nested linearlayouts, try this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/LOC_IMAGE"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:width="38dp"
android:gravity="left"
android:src="#drawable/ondergrondse2" />
<TextView
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="15dp"
android:width="60dp"
android:gravity="center"
android:id="#+id/LOC_CODE" />
<TextView
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="15dp"
android:width="60dp"
android:gravity="center"
android:id="#+id/LOC_FRACTIE" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/LOC_NAME"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Niet aanwezig"
android:layout_marginTop="10dp"
android:layout_marginLeft="35dp"
android:textSize="15dp"
android:width="330dp"
android:layout_marginRight="20dp" />
</LinearLayout>
</LinearLayout>
Do like this,just nest the widget
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="fill_parent">``
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/ImageView01"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:gravity="left"
android:src="#drawable/ondergrondse2"
android:width="38dp" />
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="0"
android:textColor="#FFFFFF"
android:textSize="15dp"
android:width="60dp" />
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="0"
android:textColor="#FFFFFF"
android:textSize="15dp"
android:width="60dp" />
</LinearLayout>
<TextView
android:id="#+id/LOC_NAME"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:text="Niet aanwezig"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="15dp"
android:width="330dp" />
</LinearLayout>
</LinearLayout>
LinearLayouts Order ther ChildViews in a linear way if you want them to be ordererd Verticaly you should change the android:orientation="horizontal"
to android:orientation="vertical", this wil align your views verticaly from top to bottom so to achieve what you want tou shoud do this
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/LOC_IMAGE"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:width="38dp"
android:gravity="left"
android:src="#drawable/ondergrondse2" />
<TextView
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="15dp"
android:width="60dp"
android:gravity="center"
android:id="#+id/LOC_CODE" />
<TextView
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="15dp"
android:width="60dp"
android:gravity="center"
android:id="#+id/LOC_FRACTIE" />
</LinearLayout>
<TextView
android:id="#+id/LOC_NAME"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Niet aanwezig"
android:layout_marginTop="10dp"
android:layout_marginLeft="35dp"
android:textSize="15dp"
android:width="330dp"
android:layout_marginRight="20dp" />
</LinearLayout>
I have created a Scroll view and it contains some Linear layouts that contains some views but issue is that the last view is not showing inside scroll view My Linear layout is not expending and android:fillViewport="true" is not working, i will post screen shot
MY Output is
MY XML CODE IS
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_filters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2f3f9f"
android:minHeight="?attr/actionBarSize"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar" >
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="FILTERS"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</android.support.v7.widget.Toolbar>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:layout_below="#+id/toolbar_filters"
android:background="#202231" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#202231"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal"
android:weightSum="2" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/open_now"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="5dp"
android:text="Opne Now"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_open_now"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/smoking_inside"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Smoking Inside"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_smoking_inside"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/shots"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Shots"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_shots"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/vvip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="VVIP"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_vvip"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/terrace"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Terrace"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_terrace"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
</LinearLayout>
<View
android:id="#+id/view_vertical"
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#2a2d41" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/karoake"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="5dp"
android:text="Karaoke"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_karoake"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/cigar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Cigar"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_cigar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="VIP"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_vip"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/sea_side"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Sea Side"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_sea_side"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/swimming_pool"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Swimming Pool"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_swimming_pool"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/music_selection_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="Music"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_music_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text="(0)"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_music_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/cuisine_layouts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_cuisines"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="Cuisines"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_cuisines_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text="(0)"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_cuisines_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/outlet_type_layouts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="Type"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_type_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text="(0)"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_type_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_cover_charges_upto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:gravity="left"
android:text="COVER CHARGES UPTO"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="#+id/filter_cover_charges_upto_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="#drawable/back"
android:gravity="left"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text="50"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/seekBar_value_min"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="5dp"
android:gravity="top"
android:text="0"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/white" />
<SeekBar
android:id="#+id/seekBar1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:max="999" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:gravity="top"
android:text="999"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/white" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_guest_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="GUESTLIST UPTO"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="2dp"
android:text="23:30"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_arrow_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="#+id/wrapper_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >
<Button
android:id="#+id/activate_plans_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2f3f9f"
android:text="SUBMIT"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
</RelativeLayout>
Change height of ScrollView to wrap content or you can also put your ScrollView and the last LinearLayout into another LinearLayout having vertical orientation with fill_parent dimensions and add the weight property to both of them.
Try this for your last Linear Layout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="20dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_guest_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="GUESTLIST UPTO"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="2dp"
android:text="23:30"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_arrow_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
I'm trying to add admob into my android app, but I keep having this error in eclipse:
Element type "com.admob.android.ads.AdView" must be followed by either attribute specifications,
">" or "/>".
The code is:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.example.SampleApp"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.admob.android.ads.AdView android:id="#+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"</com.admob.android.ads.AdView>
</LinearLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00BFFF"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="#+id/txt_stupnjevi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/txt_grad"
android:layout_below="#+id/txt_grad"
android:layout_marginTop="5dp"
android:textColor="#FFF"
android:textSize="40sp" />
<ImageView
android:id="#+id/img_glavna"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout1"
android:layout_below="#+id/txt_stupnjevi"
android:layout_centerHorizontal="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:adjustViewBounds="true"
android:src="#drawable/img01d" />
<TextView
android:id="#+id/txt_grad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/img_glavna"
android:layout_alignParentTop="true"
android:textColor="#FFF"
android:textSize="35sp" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminate="true"
android:visibility="gone" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:baselineAligned="false"
android:weightSum="3" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/txt_dan1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:maxLength="3"
android:paddingTop="10dp"
android:textColor="#FFF"
android:textSize="20sp" />
<ImageView
android:id="#+id/img_dan1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/img01n" />
<TextView
android:id="#+id/txt_stupnjevi1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:paddingBottom="10dp"
android:textColor="#FFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/txt_dan2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:maxLength="3"
android:paddingTop="10dp"
android:textColor="#FFF"
android:textSize="20sp" />
<ImageView
android:id="#+id/img_dan2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/img11d" />
<TextView
android:id="#+id/txt_stupnjevi2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:textColor="#FFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/txt_dan3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:maxLength="3"
android:paddingTop="10dp"
android:textColor="#FFF"
android:textSize="20sp" />
<ImageView
android:id="#+id/img_dan3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/img13n" />
<TextView
android:id="#+id/txt_stupnjevi3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:textColor="#FFF"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/txt_stupnjevi"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/txt_grad"
android:layout_marginRight="16dp"
android:orientation="vertical"
android:weightSum="3" >
<TextView
android:id="#+id/txt_tlak"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:drawablePadding="10dip"
android:drawableRight="#drawable/e2"
android:gravity="center_vertical|center_horizontal"
android:textColor="#FFF"
android:textSize="18sp" />
<TextView
android:id="#+id/txt_vlaznost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:drawablePadding="10dip"
android:drawableRight="#drawable/d1"
android:gravity="center_vertical|center_horizontal"
android:textColor="#FFF"
android:textSize="18sp" />
<TextView
android:id="#+id/txt_brzina"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:drawablePadding="10dip"
android:drawableRight="#drawable/wind"
android:gravity="center_vertical|center_horizontal"
android:textColor="#FFF"
android:textSize="18sp" />
</LinearLayout>
<TextView
android:id="#+id/txt_stanje"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:textColor="#FFF"
android:textSize="18sp" />
</RelativeLayout>
What I should do to solve this?
i got this error too:
The markup in the document following the root element must be well-formed.
Just replace
<com.admob.android.ads.AdView android:id="#+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"></com.admob.android.ads.AdView>