
Android怎么得到Layout里的布局文件里的自定义组件
2个回答
展开全部
首先获取当前Activity的LayoutInflater:
LayoutInflater factory=LayoutInflater.from(this);
接着使用LayoutInflater对象获取Layout
final View DialogView=factory.inflate(R.layout.dialog, null);
最后使用该layout获取组件
m_EditText1=(EditText)DialogView.findViewById(R.id.ip_address2);
LayoutInflater factory=LayoutInflater.from(this);
接着使用LayoutInflater对象获取Layout
final View DialogView=factory.inflate(R.layout.dialog, null);
最后使用该layout获取组件
m_EditText1=(EditText)DialogView.findViewById(R.id.ip_address2);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询