英文:
How to set icon right side and bottom of TextInputEditText in android
问题
I will create a program framework that includes the necessary modules for an automated Chinese paper writing program, as requested. I will focus solely on providing code based on the information provided in the 'lunwen.txt' file. If the file is large, I will provide the code in batches and ensure nothing is missed. Here's the initial code snippet for the program framework:
# Define modules for the program framework
class TopicGeneratorModule:
def generate_topics(self, user_input):
# Code to generate a list of research topics based on user input
pass
class KeywordGeneratorModule:
def generate_keywords(self, selected_topic):
# Code to automatically extract and generate keywords related to the selected topic
pass
# More module definitions here...
# Define the main program loop
def main():
# Initialize modules
topic_generator = TopicGeneratorModule()
keyword_generator = KeywordGeneratorModule()
# Initialize other modules...
while True:
# User interaction code
user_input = input("Enter your research field or interest: ")
# Generate topics based on user input
topics = topic_generator.generate_topics(user_input)
# User selects a topic
selected_topic = topics[0] # For demonstration purposes
# Generate keywords based on the selected topic
keywords = keyword_generator.generate_keywords(selected_topic)
# Display generated keywords
print("Generated keywords:", keywords)
# Other parts of the program...
break # For demonstration purposes
if __name__ == "__main__":
main()
Please note that this is just an initial code snippet for the framework and some module placeholders. The actual implementation of each module's functionality will depend on the specific requirements and libraries you choose to use. If you have specific requests or modifications, please let me know.
英文:
How to set icon right side and bottom of TextInputEditText in android
Show Image
答案1
得分: 0
您可以使用这个技巧:
<RelativeLayout
android:layout_width="match_parent"
android:layout_margin="5dp"
android:layout_height="200dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/outlinedTextField"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="@string/label"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.google.android.material.textfield.TextInputLayout>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_microphone"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="5dp" />
</RelativeLayout>
英文:
You can use this trick
<RelativeLayout
android:layout_width="match_parent"
android:layout_margin="5dp"
android:layout_height="200dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/outlinedTextField"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="@string/label"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</com.google.android.material.textfield.TextInputLayout>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_microphone"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="5dp"/>
</RelativeLayout>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论