- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经使用回收器 View 和可扩展 ListView 创建了可扩展 ListView
<?xml version="1.0" encoding="utf-8"?>
<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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context="com.example.soulsystem_4.myapplication.ProjectDetails">
<android.support.v4.widget.NestedScrollView
android:layout_above="@+id/bottom_layout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical"
android:id="@+id/project"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/top"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--First linear section-->
<LinearLayout
android:orientation="vertical"
android:layout_weight="0.2"
android:layout_width="match_parent"
android:layout_height="@dimen/firstlinear">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:id="@+id/imageViewProjdetail"
android:adjustViewBounds="true"
android:scaleType="fitXY"/></LinearLayout>
<!--Second linear section-->
<LinearLayout
android:orientation="vertical"
android:layout_weight="0.25"
android:layout_width="match_parent"
android:layout_height="@dimen/secondlinear">
<LinearLayout
android:orientation="vertical"
android:layout_weight="0.6"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textSize="20sp"
android:id="@+id/price"
android:text="$1,149"
android:layout_weight="0.8"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/morgage"
android:layout_weight="1"
android:layout_gravity="center"
android:text="Est. Mortgage $4.7K/mo Get Pre-Qualified"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:paddingBottom="10dp"
android:orientation="horizontal"
android:layout_weight="0.4"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.75">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/address"
android:lines="3"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_weight="2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/bedroom"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<TextView
android:id="@+id/bathroom"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<TextView
android:id="@+id/sqft"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.25"></LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"/>
<!--Third linear-->
<LinearLayout
android:layout_weight="0.25"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="For Sale Home Details"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<at.blogc.android.views.ExpandableTextView
android:id="@+id/expandableTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/lorem_ipsum"
android:maxLines="4"
android:ellipsize="end"
app:animation_duration="1000"/>
<!-- Optional parameter animation_duration: sets the duration of the expand animation -->
<Button
android:id="@+id/button_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:text="EXPAND"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="?android:attr/listDivider"/>
<LinearLayout
android:id="@+id/direction"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_gravity="center"
android:background="@mipmap/car"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<TextView
android:paddingLeft="10dp"
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/Green_ForestGreen"
android:text="Driving Direction"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="?android:attr/listDivider"/>
<LinearLayout
android:id="@+id/street_view"
android:layout_weight="1"
android:paddingLeft="15dp"
android:paddingBottom="15dp"
android:paddingTop="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_gravity="center"
android:background="@mipmap/car"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<TextView
android:paddingLeft="10dp"
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/Green_ForestGreen"
android:text="Street view"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="?android:attr/listDivider"/>
<LinearLayout
android:layout_weight="1"
android:paddingLeft="15dp"
android:paddingBottom="15dp"
android:paddingTop="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textSize="16sp"
android:paddingBottom="20dp"
android:textColor="@color/Green_ForestGreen"
android:text="Schedule a tour"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!--Recycler view-->
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="?android:attr/listDivider"/>
<TextView
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:textSize="18dp"
android:textColor="#454545"
android:textStyle="bold"
android:text="Request Info"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include layout="@layout/activity_recycle"></include>
<EditText
android:background="@drawable/shape_edittext"
android:hint="Your e-mail address"
android:padding="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:background="@drawable/shape_edittext"
android:hint="Your phone number"
android:padding="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:background="@drawable/shape_edittext"
android:height="80dp"
android:hint="Your message"
android:padding="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<!--Bottom fixed section-->
<LinearLayout
android:id="@+id/bottom_layout"
android:background="@color/Red_OrangeRed"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:padding="@dimen/bottomlinear"
android:paddingLeft="5dp"
android:textColor="@color/white"
android:textAlignment="center"
android:text="Request Info"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>
</RelativeLayout>
这是我的看法
此 View 的 Activity 文件如下。我在那个 xml 中使用了另一个 xml 作为子项,我添加了 2 个 TextView 并使用这 2 个 TextView 传递了值。但是社区信息不同,我想在其中添加 4 个 TextView 。如何在此列表中添加不同的子 xml。
Phone phone=new Phone( );
final private String TAG = ProjectDetails.class.getSimpleName();
TextView textView2_buildingName,textView2_buildeName,textView2_adds;
ImageView imageViewProjdetail;
Project project=new Project();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_project_details);
imageViewProjdetail=(ImageView)findViewById(R.id.imageViewProjdetail);
textView2_buildingName=(TextView)findViewById(R.id.textView2_buildingName);
textView2_buildeName=(TextView)findViewById(R.id.textView2_buildeName);
textView2_adds=(TextView)findViewById(R.id.textView2_adds);
relativeLayout = (LinearLayout)findViewById(R.id.project);
relativeLayout.setOrientation(LinearLayout.VERTICAL);
final ScrollView scrollView = new ScrollView(getApplicationContext());
relativeLayout.addView(scrollView);
final LinearLayout linearLayout = new LinearLayout(getApplicationContext());
linearLayout.setOrientation(LinearLayout.VERTICAL);
scrollView.addView(linearLayout);
//textView2_aptType=(TextView)findViewById(R.id.textView2_aptType);
// textView3_prsqft=(TextView)findViewById(R.id.textView3_prsqft);
recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
mobileOSes = new ArrayList<>();
//textView2_aptType.setText(getIntent().getStringExtra("textView2_aptType"));
//textView3_prsqft.setText(getIntent().getStringExtra("textView3_prsqft"));
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
adapter = new RecyclerAdapterDemo(this, mobileOSes);
recyclerView.setAdapter(adapter);
String homeDetail[]={""};
phone.setStatus("For Sale");
phone.setPrice("$1,149,000");
phone.setPricePerSqft("$944");
phone.setBeds("1");
phone.setBaths("1.5");
// setData();
ArrayList<Phone> features = new ArrayList<>();
/*Change the class name and access all the values*/
features.add(new Phone("Status","For Sale"));
features.add(new Phone("Price","$1,149,000"));
features.add(new Phone("Price/sqft","$944"));
features.add(new Phone("Beds","1"));
features.add(new Phone("Baths","1.5"));
features.add(new Phone("Sqft","1,216"));
features.add(new Phone("Built In","2008"));
features.add(new Phone("Property Type","Single-Family Home"));
features.add(new Phone("Added On","304 days ago"));
features.add(new Phone("Total Views","8491"));
features.add(new Phone("Neighborhood","South Beach"));
ArrayList<Phone> providedBy = new ArrayList<>();
providedBy.add(new Phone("Agent","Paul Hwang"));
providedBy.add(new Phone("Agent Phone","4157993542"));
providedBy.add(new Phone("Broker","Skybox Realty"));
providedBy.add(new Phone("Broker Phone","415-216-8743"));
providedBy.add(new Phone("Provided By","Skybox Realty"));
ArrayList<Phone> neighborhoodinfo = new ArrayList<>();
neighborhoodinfo.add(new Phone("Crime: Lowest",""));
neighborhoodinfo.add(new Phone("Affordability: 1.3M",""));
neighborhoodinfo.add(new Phone("Amenities : Nearby Shopping,Groceries,Restaurants",""));
ArrayList<Phone> monMortagage = new ArrayList<>();
monMortagage.add(new Phone("Nokia Lumia 800",""));
monMortagage.add(new Phone("Nokia Lumia 710",""));
monMortagage.add(new Phone("Nokia Lumia 900",""));
ArrayList<Phone> ptaxnadAssessment = new ArrayList<>();
ptaxnadAssessment.add(new Phone("Nokia Lumia 800",""));
ptaxnadAssessment.add(new Phone("Nokia Lumia 710",""));
ptaxnadAssessment.add(new Phone("Nokia Lumia 900",""));
ArrayList<Phone> publicRec = new ArrayList<>();
publicRec.add(new Phone("Nokia Lumia 800",""));
publicRec.add(new Phone("Nokia Lumia 710",""));
publicRec.add(new Phone("Nokia Lumia 900",""));
mobileOSes.add(new MobileOS("Features", features));
mobileOSes.add(new MobileOS("Provided By", providedBy));
mobileOSes.add(new MobileOS("Neighborhood Info", neighborhoodinfo));
mobileOSes.add(new MobileOS("Monthly Mortgage", monMortagage));
mobileOSes.add(new MobileOS("Property Taxes and Assessment", ptaxnadAssessment));
mobileOSes.add(new MobileOS("Public Records", publicRec));
direction = (LinearLayout)findViewById(R.id.direction);
/*Just pass the destination address no need to add my location*/
direction.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?daddr=19.0641135,72.9947516" ));
intent.setClassName("com.google.android.apps.maps","com.google.android.maps.MapsActivity");
startActivity(intent);
}
});
/*Street view*/
street_view = (LinearLayout)findViewById(R.id.street_view);
street_view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(ProjectDetails.this, MapsActivity.class);
startActivity(intent);
}
});
final ExpandableTextView expandableTextView = (ExpandableTextView) this.findViewById(R.id.expandableTextView);
final Button buttonToggle = (Button) this.findViewById(R.id.button_toggle);
// set animation duration via code, but preferable in your layout files by using the animation_duration attribute
expandableTextView.setAnimationDuration(1000L);
// set interpolators for both expanding and collapsing animations
expandableTextView.setInterpolator(new OvershootInterpolator());
// or set them separately
expandableTextView.setExpandInterpolator(new OvershootInterpolator());
expandableTextView.setCollapseInterpolator(new OvershootInterpolator());
// toggle the ExpandableTextView
buttonToggle.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(final View v)
{
expandableTextView.toggle();
buttonToggle.setText(expandableTextView.isExpanded() ? R.string.collapse : R.string.expand);
}
});
// but, you can also do the checks yourself
buttonToggle.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(final View v)
{
if (expandableTextView.isExpanded())
{
expandableTextView.collapse();
buttonToggle.setText(R.string.expand);
}
else
{
expandableTextView.expand();
buttonToggle.setText(R.string.collapse);
}
}
});
// listen for expand / collapse events
expandableTextView.setOnExpandListener(new ExpandableTextView.OnExpandListener()
{
@Override
public void onExpand(final ExpandableTextView view)
{
Log.d(TAG, "ExpandableTextView expanded");
}
@Override
public void onCollapse(final ExpandableTextView view)
{
Log.d(TAG, "ExpandableTextView collapsed");
}
});
imageViewProjdetail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i= new Intent(ProjectDetails.this,Slideshow.class);
//i.putExtra("position",a);
startActivity(i);
}
});
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
adapter.onSaveInstanceState(outState);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
adapter.onRestoreInstanceState(savedInstanceState);
}
}
这是适配器类公共(public) RecyclerAdapterDemo( Activity Activity ,列表组){ super (团体); this.activity = Activity ;
@Override
public OSViewHolder onCreateGroupViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.group_view_holder, parent, false);
return new OSViewHolder(view);
}
@Override
public PhoneViewHolder onCreateChildViewHolder(ViewGroup parent, final int viewType) {
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.child_view_holder, parent, false);
return new PhoneViewHolder(view);
}
@Override
public void onBindChildViewHolder(PhoneViewHolder holder, int flatPosition, ExpandableGroup group, int childIndex) {
final Phone phone = ((MobileOS)group).getItems().get(childIndex);
holder.onBind(phone,group);
}
@Override
public void onBindGroupViewHolder(OSViewHolder holder, int flatPosition, ExpandableGroup group) {
holder.setGroupName(group);
}
最佳答案
此链接已回答我的问题。我必须使用 HeterogeneousExpandableList 接口(interface)来获取列表中的不同子项。 Different Child Layouts for different groups ExpandableListView
关于android - 如何在可扩展 ListView 中添加不同的 child ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39747792/
我的收藏具有以下结构 { _id:1, parent_id:0 } { _id:2, parent_id:1 } { _id:3, parent_id:1 } { _id:4, par
到目前为止,我已经尝试过获取该对象的所有子对象,但它只带来了两个子对象。不都是 child 的 child 。我如何获取所有内容并循环获取特定名称对象 Transform[] objChild = g
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
我有一个如下表 好吧,在这个表中每个用户都有一个父用户,那么如果我们选择一个用户,那么它的 id 、子代 id 和子代子代 id 应该作为数组返回。我需要一个查询来获取 Rails 中的这些值,而不使
我需要以下代码的帮助: HTML: process process 在点击 td[class=process] 时,我需要 input[name=dat
好的,所以我从中获得了一个 PHP,该 PHP 由依赖于手头动态情况的切换循环传播(我认为)。现在,当我添加一个复选框时,我希望能够使 div 中的第一个复选框具有顶部边框和侧面,没有底部。下面的只有
我正在使用 Swift 和 Sprite Kit。我有一个名为 MrNode 的 SKNode,它有多个 SKSpriteNodes 和 SKNode 子节点。一些SKNode有子节点,而这些子节点也
对不起,这个标题太俗了,但我真的不确定如何解释这个,我是新一代的 SQL 技能由于事件记录模式而退化的人之一! 基本上我在 PostgreSQL 中有三个表 客户端(一个客户端有很多 map ) -
我有这样的简单表格: 编号 parent_id 创建于 具有父/子关系...如果一行是子行,则它有一个 parent_id,否则它的 parent_id 为 0。 现在我想选择所有没有子项(因此本身)
所以我有这样的结构: 我的问题是:如何从每个主题中删除 ID 为 3Q41X2tKUMUmiDjXL1BJon70l8n2 的每个字段。我正在考虑这样的事情: admin.database().ref
这个问题在这里已经有了答案: Change opacity on all elements except hovered one (1 个回答) 关闭 5 个月前。 因此,当鼠标悬停在 child
我需要在 Delphi 5 中创建一个 QuickReport,其布局如下: +================ | Report Header +================ +========
假设我有这样的 html: Some more detailed code.... 我想知道如何在CSS中使用“A
我有一个使用 flexbox 的类似表格的布局: +--------------+---------------+-----------------+---------------+ | 1
我有一个关联,其中 user has_many user_items 和 user_items has_many user_item_images。与一个已经退出的用户。我可以创建一个新的 user_
我想选择无序列表中的前两个列表项。我可以这样选择第一项: ul li:nth-child(1) a { background: none repeat scroll 0 0 beige; }
ul li:first-child a { border-radius: 5px 5px 0 0; } ul li:last-child a { border-radius: 0 0 5p
我有一个这样的表:
或者这些术语用于指代同一事物? 我正在尝试在我的 Win32 应用程序中实现一些显示位图图像的自定义按钮。一个教程指出我应该使用 CreateWindow() 创建子窗口。 但是,我已经从另一个关于创
我想在 jquery 中获取我的 svg 的 id,我尝试了这个 jquery,但它是未定义的。 $(event.target).children('svg').attr("id") Target.e
我是一名优秀的程序员,十分优秀!