I have a table containing two tableRows each holding four Views: texView, Spinner, editView and texView.
When the content of one of the spinner's childs doesn't fit, it is automatically cut of, which is fine. However I want the editView next to it keep a minimum width of 40dp. Now the width of the textViews are preserved but the editView width is not. How can I achieve that (if not by setting width and/or minwidth as I tried now, see xml file)?
Up until this child's length its fine:
Now its not so fine:
Here's the layout file:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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"
tools:ignore="InefficientWeight" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Worp "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView1"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="true"
android:tag="SP1" />
<EditText
android:id="#+id/editText1"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="phone"
android:minWidth="40dp" />
<TextView
android:id="#+id/textView4"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView2"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="true"
android:tag="SP2" />
<EditText
android:id="#+id/editText2"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="phone"
android:minWidth="40dp" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView5"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>
</ScrollView>
It seems that because of the wrap_content attribute the width of your table column is changing. Try to change the attributes of table row from wrap_content to match_parent or try using weightSum.
Related
I made an .xgmml file to load into cytoscape. In the .xgmml I have different weights and colours for the edges (See bottom for the .xgmml file). However, when I load the .xgmml file into cytoscape and apply layout, the edges have the same weights and colour.
How can I apply the .xgmml edge weights and colours to the network?
<?xml version="1.0" encoding="UTF-8" ?>
<graph label="Depression" directed="0" xmlns="http://www.cs.rpi.edu/XGMML" schemaLocation="http://www.cs.rpi.edu/~puninj/XGMML/xgmml.xsd">
<node id="A" label="A">
<graphics type="rectangle" fill="#F8FF00"/>
<att name="description" value="A"/>
</node>
<node id="B" label="B">
<graphics type="triangle" fill="#CC51FF"/>
<att name="description" value="B"/>
</node>
<node id="C" label="C">
<graphics type="triangle" fill="#CC51FF"/>
<att name="description" value="C"/>
</node>
<edge id="rs2" label="TRANS" source="A" target="B" weight="10">
<att name="edge.shape" value="circle"/>
<att name="edge.color" value="51,153,25"/>
</edge>
<edge id="rs1" label="CIS" source="A" target="C" weight="1">
<att name="edge.shape" value="circle"/>
<att name="edge.color" value="0,153,0"/>
</edge>
</graph>
We don't use those properties. For color and width, we encode them as attributes in the graphic line:
<edge id="732" label="YDR412W (pp) YPR119W" source="386" target="382" cy:directed="1">
<att name="shared name" value="YDR412W (pp) YPR119W" type="string" cy:type="String"/>
<att name="shared interaction" value="pp" type="string" cy:type="String"/>
<att name="name" value="YDR412W (pp) YPR119W" type="string" cy:type="String"/>
<att name="selected" value="1" type="boolean" cy:type="Boolean"/>
<att name="interaction" value="pp" type="string" cy:type="String"/>
<att name="EdgeBetweenness" value="18040.0" type="real" cy:type="Double"/>
<att name="isInPath" value="0" type="boolean" cy:type="Boolean" cy:hidden="1"/>
<graphics width="5.0" fill="#FF00FF">
<att name="EDGE_STROKE_SELECTED_PAINT" value="#FF0000" type="string" cy:type="String"/>
<att name="EDGE_SELECTED" value="true" type="string" cy:type="String"/>
<att name="EDGE_TOOLTIP" value="" type="string" cy:type="String"/>
<att name="EDGE_LABEL_COLOR" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_BEND" value="" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_UNSELECTED_PAINT" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SELECTED_PAINT" value="#FFFF00" type="string" cy:type="String"/>
<att name="EDGE_LABEL" value="" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SIZE" value="6.0" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SIZE" value="6.0" type="string" cy:type="String"/>
<att name="EDGE_CURVED" value="true" type="string" cy:type="String"/>
<att name="EDGE_VISIBLE" value="true" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SELECTED_PAINT" value="#FFFF00" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SHAPE" value="NONE" type="string" cy:type="String"/>
<att name="EDGE_LABEL_TRANSPARENCY" value="255" type="string" cy:type="String"/>
<att name="EDGE_TRANSPARENCY" value="170" type="string" cy:type="String"/>
<att name="EDGE_LINE_TYPE" value="SOLID" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_UNSELECTED_PAINT" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_LABEL_FONT_FACE" value="Dialog.plain,plain,10" type="string" cy:type="String"/>
<att name="EDGE_LABEL_FONT_SIZE" value="10" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SHAPE" value="NONE" type="string" cy:type="String"/>
<att name="EDGE_LABEL_WIDTH" value="200.0" type="string" cy:type="String"/>
</graphics>
</edge>
This results in a magenta edge of width 5.
-- scooter
I have created a design with the following source axml:
when the listview output is shown getting data from the sqllite database the listview will overlap the test textview,edittext as below:
Required Output Result Listview should be below as shown below:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#ffffff"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:text="#string/test"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="87.5dp"
android:layout_height="wrap_content"
android:id="#+id/test"
android:textColor="#android:color/black" />
<EditText
android:id="#+id/test_input"
android:layout_height="wrap_content"
android:layout_width="152.0dp"
android:inputType="text"
android:layout_toRightOf="#+id/test" />
<Button
android:id="#+id/MyButton"
android:layout_width="128.5dp"
android:layout_height="wrap_content"
android:text="#string/ButtonClick"
android:layout_toRightOf="#+id/test_input" />
<ListView
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/listtable"
android:layout_alignBottom="#+id/MyButton" />
</RelativeLayout>
Assuming you are using the Appcompat Library i would do the following changes to your layout :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:orientation="horizontal"
android:id="#+id/LinearContent"
android:layout_alignParentTop="true"
android:layout_height="wrap_content">
<TextView
android:text="Test"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="87.5dp"
android:layout_height="wrap_content"
android:id="#+id/test"
android:textColor="#android:color/black" />
<EditText
android:id="#+id/test_input"
android:layout_height="wrap_content"
android:layout_width="152.0dp"
android:inputType="text"
android:layout_toRightOf="#+id/test" />
<Button
android:id="#+id/MyButton"
android:layout_width="128.5dp"
android:layout_height="wrap_content"
android:text="Search"
android:layout_toRightOf="#+id/test_input" />
</android.support.v7.widget.LinearLayoutCompat>
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_below="#id/LinearContent"
android:layout_height="wrap_content">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/listtable"
/>
</android.support.v7.widget.LinearLayoutCompat>
Revert in case it doesn't work
Solved.
Change the properties of list view with the following:
android:layout_alignBottom to
android:layout_below
I am using a nested scrollview in CoordinatorLayout I have different horizontal cords which are stacked in nested scrollview . I am unable to fix the space which is not required (I have added blue color to the space).
Anybody any fix or what am I doing wrong?
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fresco="http://schemas.android.com/tools"
android:id="#+id/cordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00f"
app:layout_scrollFlags="scroll|enterAlways">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="300dp"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsingToolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/movie_poster"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="pin"
fresco:placeholderImage="#drawable/placeholder" />
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
app:tabContentStart="72dp"
app:tabMode="scrollable" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/appBar"
android:fitsSystemWindows="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#0f0"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/info_card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/plot_synopsis"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/cardview_dark_background"
android:maxLines="4"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="#fff"
android:textSize="21sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cardview_dark_background"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:baselineAligned="false"
android:orientation="vertical"
android:padding="10dp"
android:weightSum="4">
<TextView
android:id="#+id/release_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fff"
android:textSize="20sp" />
<TextView
android:id="#+id/vote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fff"
android:textSize="20sp" />
</LinearLayout>
<Button
android:id="#+id/b11"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/fav" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:id="#+id/nextAirLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:background="#color/cardview_dark_background"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="#string/next_episode"
android:textColor="#fff"
android:textStyle="bold" />
<include
layout="#layout/episode_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<include
android:id="#+id/tvSeasonsCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<include
android:id="#+id/tvCastCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<include
android:id="#+id/videosCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<include
android:id="#+id/similarTvShowsCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<include
android:id="#+id/recommendedTvShowsCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
I have a layout in which I have 4 edittext in nestedscrollview
<?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">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#android:color/white"
>
<TextView
android:id="#+id/back"
android:layout_width="50dp"
android:layout_height="50dp"
android:textColor="#android:color/black"
android:textSize="17sp"
android:background="#drawable/logo" />
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#android:color/black"
android:textSize="17sp" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView 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:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:scrollbars="vertical"
android:focusable="true"
android:focusableInTouchMode="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="labs108.com.dentalstudent.activity.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
android:orientation="vertical">
<TextView
android:id="#id/name"
android:layout_marginTop="5dp"
android:text="#string/mayank_agrawal"
android:textSize="17sp"
android:textStyle="bold"
android:textDirection="ltr"
android:gravity="center_horizontal"
android:textColor="#android:color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/mobile"
android:layout_marginTop="5dp"
android:text="#string/mobile_no"
android:textSize="14sp"
android:textDirection="ltr"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/gender"
android:layout_marginTop="5dp"
android:text="#string/gender_text"
android:textSize="14sp"
android:textStyle="bold"
android:textDirection="ltr"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/age"
android:layout_marginTop="5dp"
android:text="#string/age_text"
android:textSize="14sp"
android:textDirection="ltr"
android:textStyle="bold"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/date"
android:layout_marginTop="5dp"
android:text="#string/date"
android:textSize="14sp"
android:textDirection="ltr"
android:textStyle="bold"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/explain"
android:layout_marginTop="5dp"
android:text="#string/explain"
android:textSize="14sp"
android:textDirection="ltr"
android:textStyle="bold"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/complain"
android:layout_marginTop="5dp"
android:text="#string/complain_text"
android:textSize="14sp"
android:textDirection="ltr"
android:textStyle="bold"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="10dp"
android:text="#string/upload_pic"
android:textSize="14sp"
android:gravity="center_horizontal"
android:textDirection="ltr"
android:textColor="#android:color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="#+id/progressbar1"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge" />
<ImageView
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/pic1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:layout_width="350dp"
android:layout_height="200dp" />
</RelativeLayout>
<TextView
android:gravity="center_horizontal"
android:id="#+id/show1"
android:text="Show Pic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/edit1"
android:layout_marginTop="30dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:gravity="start"
android:textDirection="anyRtl"
android:scrollbars="vertical"
android:textAlignment="viewStart"
android:background="#android:drawable/editbox_background_normal"
android:layout_width="match_parent"
android:layout_height="150dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="#+id/progressbar2"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge" />
<ImageView
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/pic2"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:layout_width="350dp"
android:layout_height="200dp" />
</RelativeLayout>
<TextView
android:gravity="center_horizontal"
android:id="#+id/show2"
android:text="Show Pic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/edit2"
android:layout_marginTop="30dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:gravity="start"
android:textDirection="anyRtl"
android:scrollbars="vertical"
android:textAlignment="viewStart"
android:background="#android:drawable/editbox_background_normal"
android:layout_width="match_parent"
android:layout_height="150dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="#+id/progressbar3"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge" />
<ImageView
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/pic3"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:layout_width="350dp"
android:layout_height="200dp" />
</RelativeLayout>
<TextView
android:gravity="center_horizontal"
android:id="#+id/show3"
android:text="Show Pic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/edit3"
android:layout_marginTop="30dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:gravity="start"
android:textDirection="anyRtl"
android:scrollbars="vertical"
android:textAlignment="viewStart"
android:background="#android:drawable/editbox_background_normal"
android:layout_width="match_parent"
android:layout_height="150dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="#+id/progressbar4"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge" />
<ImageView
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/pic4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:layout_width="350dp"
android:layout_height="200dp" />
</RelativeLayout>
<TextView
android:gravity="center_horizontal"
android:id="#+id/show4"
android:text="Show Pic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/edit4"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:gravity="start"
android:textDirection="anyRtl"
android:scrollbars="vertical"
android:textAlignment="viewStart"
android:background="#android:drawable/editbox_background_normal"
android:layout_width="match_parent"
android:layout_height="150dp" />
<TextView
android:id="#id/save"
android:layout_marginTop="10dp"
android:text="#string/save"
android:textDirection="ltr"
android:layout_marginBottom="60dp"
android:textSize="15sp"
android:background="#android:drawable/editbox_background_normal"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textColor="#android:color/holo_green_light"
android:layout_width="200dp"
android:layout_height="40dp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
WHen I enter text in edittext and press enter from keyboard, scrollview also scroll and with multiple enter, edittext is completely invisible because of scrolling of scrollview.
is there any thing wrong in layout?
I am trying to convert the DragnDrop listview from here https://github.com/commonsguy/cwac-touchlist to C# with Mono for Android.
Part of this custom View requires the use of some custom attributes that are declared as the following inside the file Resources/values/attrs.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="TouchListView">
<attr name="normal_height" format="dimension" />
<attr name="expanded_height" format="dimension" />
<attr name="grabber" format="reference" />
<attr name="dragndrop_background" format="color" />
<attr name="remove_mode">
<enum name="none" value="-1" />
<enum name="fling" value="0" />
<enum name="slide" value="1" />
<enum name="slideRight" value="1" />
<enum name="slideLeft" value="2" />
</attr>
</declare-styleable>
</resources>
I then try to use them inside my layout file like this:
<app.monodroid.TouchListView xmlns:tlv="http://schemas.android.com/apk/res/app.monodroid"
android:id="#+id/lstExercises"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/lExerciseActions"
android:drawSelectorOnTop="false"
tlv:normal_height="64dip"
tlv:grabber="#+id/icon"
tlv:remove_mode="slideRight"
/>
But when I try to build my project I get the following error message:
/Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.Common.targets: Error: Tool exited with code: 1. Output: /Users/path_to_project/App.MonoDroid/obj/Debug/res/layout/add_session.axml:1: error: No resource identifier found for attribute 'normal_height' in package 'com.app.monodroid'
/Users/path_to_project/App.MonoDroid/obj/Debug/res/layout/add_session.axml:1: error: No resource identifier found for attribute 'grabber' in package 'com.app.monodroid'
/Users/path_to_project/App.MonoDroid/obj/Debug/res/layout/add_session.axml:1: error: No resource identifier found for attribute 'remove_mode' in package 'com.app.monodroid'
(App.MonoDroid)
The name of my project is App.MonoDroid.
How can I use these attributes inside my layout file?
These errors should go away if you declare a package name for your app. In the project properties, go to the Android Manifest tab, and you'll see a text field for Package Name:
... and then make sure you use this package name for your assembly and namespace:
and use it in your xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/**app.monodroid**"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<**app.monodroid**.FICalendarView
android:id="#+id/FICalendar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
custom:dayStyle="1">
</**app.monodroid**.FICalendarView>
<Button
android:id="#+id/MyButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/Hello"/>
</LinearLayout>
where FICaldendarView is a custom view defined as:
namespace app.monodroid
{
public class FICalendarView : View
{
//private FICalenderView() {}
public FICalendarView(Context context)
: base(context)
{
}
public FICalendarView(Context context, Android.Util.IAttributeSet attribute)
: base(context, attribute)
{
Android.Content.Res.TypedArray a = context.Theme.ObtainStyledAttributes(attribute, Resource.Styleable.FICalendarView, 0, 0);
//Android.Util.TypedValue typedValue = null;
int dayStyle = a.GetInteger(Resource.Styleable.FICalendarView_dayStyle,0);
}
public FICalendarView(Context context, Android.Util.IAttributeSet attribute, int x)
: base(context, attribute,x)
{
}
}
}